Skip to content

Commit

Permalink
Added to Demo Project add Created ICS File to iOS Calendar
Browse files Browse the repository at this point in the history
  • Loading branch information
Han Chengge authored and Han Chengge committed May 24, 2015
1 parent bf9d5b1 commit 7fbb87b
Show file tree
Hide file tree
Showing 10 changed files with 341 additions and 17 deletions.
Binary file modified XbICalendar/.DS_Store
Binary file not shown.
20 changes: 20 additions & 0 deletions XbICalendar/XbICalendar.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@
4DC71133197B3F27003D4962 /* XbICalendarInviteTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 4DC71132197B3F27003D4962 /* XbICalendarInviteTests.m */; };
4DC71135197B4A6A003D4962 /* XbICalendar2445Tests.m in Sources */ = {isa = PBXBuildFile; fileRef = 4DC71134197B4A6A003D4962 /* XbICalendar2445Tests.m */; };
945795251B0897B200B60E82 /* XbICFileCreateViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 945795241B0897B200B60E82 /* XbICFileCreateViewController.m */; };
946E26E71B0F60FA00418534 /* XbICCreatedFileTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 946E26E61B0F60FA00418534 /* XbICCreatedFileTableViewController.m */; };
946E26EA1B0F6B5F00418534 /* XbICAddViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 946E26E91B0F6B5F00418534 /* XbICAddViewController.m */; };
946E26EC1B0F7B9600418534 /* EventKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 946E26EB1B0F7B9600418534 /* EventKit.framework */; };
946E26EE1B0F7BA500418534 /* EventKitUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 946E26ED1B0F7BA500418534 /* EventKitUI.framework */; };
94B0AB131B05A1330057BF2D /* XbICPropertyTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 94B0AB121B05A1330057BF2D /* XbICPropertyTest.m */; };
F113ED3419863A7B00C37F81 /* 2446.ics in Resources */ = {isa = PBXBuildFile; fileRef = 4DAE352A19720D050097A2D6 /* 2446.ics */; };
F113ED3519863A7F00C37F81 /* calendar.ics in Resources */ = {isa = PBXBuildFile; fileRef = 4DAE3531197370380097A2D6 /* calendar.ics */; };
Expand Down Expand Up @@ -132,6 +136,12 @@
4DC71134197B4A6A003D4962 /* XbICalendar2445Tests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XbICalendar2445Tests.m; sourceTree = "<group>"; };
945795231B0897B200B60E82 /* XbICFileCreateViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XbICFileCreateViewController.h; sourceTree = "<group>"; };
945795241B0897B200B60E82 /* XbICFileCreateViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XbICFileCreateViewController.m; sourceTree = "<group>"; };
946E26E51B0F60FA00418534 /* XbICCreatedFileTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XbICCreatedFileTableViewController.h; sourceTree = "<group>"; };
946E26E61B0F60FA00418534 /* XbICCreatedFileTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XbICCreatedFileTableViewController.m; sourceTree = "<group>"; };
946E26E81B0F6B5F00418534 /* XbICAddViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XbICAddViewController.h; sourceTree = "<group>"; };
946E26E91B0F6B5F00418534 /* XbICAddViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XbICAddViewController.m; sourceTree = "<group>"; };
946E26EB1B0F7B9600418534 /* EventKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = EventKit.framework; path = System/Library/Frameworks/EventKit.framework; sourceTree = SDKROOT; };
946E26ED1B0F7BA500418534 /* EventKitUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = EventKitUI.framework; path = System/Library/Frameworks/EventKitUI.framework; sourceTree = SDKROOT; };
94B0AB121B05A1330057BF2D /* XbICPropertyTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XbICPropertyTest.m; sourceTree = "<group>"; };
F113ED40198643FD00C37F81 /* XbICalendarInviteWriteTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XbICalendarInviteWriteTests.m; sourceTree = "<group>"; };
F117D40619DBA6FC002CD9B5 /* XbICalendar2445Tests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = XbICalendar2445Tests.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -188,6 +198,8 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
946E26EE1B0F7BA500418534 /* EventKitUI.framework in Frameworks */,
946E26EC1B0F7B9600418534 /* EventKit.framework in Frameworks */,
F148A223194700DD00ED2C6E /* libical.a in Frameworks */,
F12F48F219332EA4003631C5 /* CoreGraphics.framework in Frameworks */,
F12F48F419332EA4003631C5 /* UIKit.framework in Frameworks */,
Expand Down Expand Up @@ -232,6 +244,8 @@
F12F48EE19332EA4003631C5 /* Frameworks */ = {
isa = PBXGroup;
children = (
946E26ED1B0F7BA500418534 /* EventKitUI.framework */,
946E26EB1B0F7B9600418534 /* EventKit.framework */,
F12F48EF19332EA4003631C5 /* Foundation.framework */,
F12F48F119332EA4003631C5 /* CoreGraphics.framework */,
F12F48F319332EA4003631C5 /* UIKit.framework */,
Expand All @@ -254,6 +268,10 @@
F12F490519332EA4003631C5 /* XbICViewController.m */,
945795231B0897B200B60E82 /* XbICFileCreateViewController.h */,
945795241B0897B200B60E82 /* XbICFileCreateViewController.m */,
946E26E51B0F60FA00418534 /* XbICCreatedFileTableViewController.h */,
946E26E61B0F60FA00418534 /* XbICCreatedFileTableViewController.m */,
946E26E81B0F6B5F00418534 /* XbICAddViewController.h */,
946E26E91B0F6B5F00418534 /* XbICAddViewController.m */,
F1A240C919C96C6F00139576 /* Bridge.h */,
);
path = XbICalendarExample;
Expand Down Expand Up @@ -535,10 +553,12 @@
F1FAB6001945B057005D0B35 /* XbICZoneDirectory.m in Sources */,
F1F5D71419402CEA00D81F71 /* XbICFileTableViewController.m in Sources */,
945795251B0897B200B60E82 /* XbICFileCreateViewController.m in Sources */,
946E26EA1B0F6B5F00418534 /* XbICAddViewController.m in Sources */,
F12F490619332EA4003631C5 /* XbICViewController.m in Sources */,
F12F4E4D1935CF03003631C5 /* XbICVEvent.m in Sources */,
F12F4928193338CB003631C5 /* XbICFile.m in Sources */,
F12F4E491935B259003631C5 /* XbICVCalendar.m in Sources */,
946E26E71B0F60FA00418534 /* XbICCreatedFileTableViewController.m in Sources */,
F1DC7727193F208500DB07D4 /* XbICPerson.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down
115 changes: 109 additions & 6 deletions XbICalendar/XbICalendarExample/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="GS0-r3-rkR" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="58" y="-61"/>
<point key="canvasLocation" x="3" y="-396"/>
</scene>
<!--XbICFileCreateViewController-->
<scene sceneID="f4S-wz-T7L">
Expand Down Expand Up @@ -109,7 +109,109 @@
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="xoC-cp-16o" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="58" y="620"/>
<point key="canvasLocation" x="3" y="258"/>
</scene>
<!--Created ICS Files-->
<scene sceneID="wVG-09-c2f">
<objects>
<tableViewController id="3BE-hN-YrW" customClass="XbICCreatedFileTableViewController" sceneMemberID="viewController">
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" id="GUh-OH-ODX">
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<connections>
<outlet property="dataSource" destination="3BE-hN-YrW" id="BRU-md-3gg"/>
<outlet property="delegate" destination="3BE-hN-YrW" id="Hma-0B-K81"/>
</connections>
</tableView>
<navigationItem key="navigationItem" title="Created ICS Files" id="wrH-9B-W2U"/>
<connections>
<segue destination="qm1-es-w2H" kind="push" identifier="detailSegue" id="25h-3g-1xn"/>
</connections>
</tableViewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="kih-GQ-b9P" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="3" y="913"/>
</scene>
<!--Add to Calendar-->
<scene sceneID="Yd7-bK-UL9">
<objects>
<viewController id="qm1-es-w2H" customClass="XbICAddViewController" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="qL3-qs-Iae"/>
<viewControllerLayoutGuide type="bottom" id="let-Pq-PT1"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="hP7-HO-mtI">
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Start:" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="r3T-S1-PI2">
<rect key="frame" x="20" y="151" width="45" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="End:" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="1Nh-qE-azG">
<rect key="frame" x="15" y="174" width="50" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Unknown" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="oyP-6V-e7z" userLabel="summaryLabel;">
<rect key="frame" x="20" y="122" width="280" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="9iQ-s3-ZGR" userLabel="startLabel">
<rect key="frame" x="80" y="151" width="220" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Sae-GY-VnB" userLabel="endLabel">
<rect key="frame" x="80" y="174" width="220" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="hVD-72-F4y">
<rect key="frame" x="104" y="287" width="112" height="30"/>
<state key="normal" title="Add to Calendar">
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<connections>
<action selector="addToCalendar:" destination="qm1-es-w2H" eventType="touchUpInside" id="vQt-17-ox9"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</view>
<navigationItem key="navigationItem" title="Add to Calendar" id="hk1-qz-3Me"/>
<connections>
<outlet property="endLabel" destination="Sae-GY-VnB" id="8Qf-o2-R2c"/>
<outlet property="startLabel" destination="9iQ-s3-ZGR" id="zhs-Jm-QGa"/>
<outlet property="summaryLabel" destination="oyP-6V-e7z" id="44C-Uq-5dh"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="Mx9-Yk-VZW" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="430" y="913"/>
</scene>
<!--Add to Calendar-->
<scene sceneID="2xB-X1-rN5">
<objects>
<navigationController id="UgA-8N-grb" sceneMemberID="viewController">
<tabBarItem key="tabBarItem" title="Add to Calendar" id="WhN-l6-RPT"/>
<navigationBar key="navigationBar" contentMode="scaleToFill" id="mEK-5j-SwI">
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
<autoresizingMask key="autoresizingMask"/>
</navigationBar>
<connections>
<segue destination="3BE-hN-YrW" kind="relationship" relationship="rootViewController" id="xeU-lW-wQX"/>
</connections>
</navigationController>
<placeholder placeholderIdentifier="IBFirstResponder" id="hJG-er-mbJ" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-468" y="913"/>
</scene>
<!--XbICFile Create-->
<scene sceneID="FPe-w9-PbU">
Expand All @@ -126,7 +228,7 @@
</navigationController>
<placeholder placeholderIdentifier="IBFirstResponder" id="xOB-eF-WjK" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-468" y="620"/>
<point key="canvasLocation" x="-468" y="258"/>
</scene>
<!--Tab Bar Controller-->
<scene sceneID="W6X-8G-VPJ">
Expand All @@ -141,11 +243,12 @@
<connections>
<segue destination="qya-Xq-rfE" kind="relationship" relationship="viewControllers" id="1lb-nx-uPp"/>
<segue destination="3sT-1z-reB" kind="relationship" relationship="viewControllers" id="yw2-lr-F5s"/>
<segue destination="UgA-8N-grb" kind="relationship" relationship="viewControllers" id="QCn-sH-rx7"/>
</connections>
</tabBarController>
<placeholder placeholderIdentifier="IBFirstResponder" id="e0e-bQ-QGv" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-985" y="258"/>
<point key="canvasLocation" x="-977" y="432"/>
</scene>
<!--XbIC View Controller-->
<scene sceneID="ufC-wZ-h7g">
Expand Down Expand Up @@ -206,7 +309,7 @@
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="x5A-6p-PRh" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="481" y="-61"/>
<point key="canvasLocation" x="473" y="-396"/>
</scene>
<!--Item-->
<scene sceneID="eik-uY-Zmv">
Expand All @@ -225,7 +328,7 @@
</navigationController>
<placeholder placeholderIdentifier="IBFirstResponder" id="Ywk-nD-uKb" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-468" y="-61"/>
<point key="canvasLocation" x="-468" y="-396"/>
</scene>
</scenes>
<simulatedMetricsContainer key="defaultSimulatedMetrics">
Expand Down
24 changes: 24 additions & 0 deletions XbICalendar/XbICalendarExample/XbICAddViewController.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
//
// XbICAddViewController.h
// XbICalendar
//
// Created by Han Chengge on 5/22/15.
// Copyright (c) 2015 GaltSoft. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface XbICAddViewController : UIViewController

@property (nonatomic, strong) NSString *fileName;
@property NSString *summary;
@property NSDate *startDate;
@property NSDate *endDate;

@property (weak, nonatomic) IBOutlet UILabel *summaryLabel;
@property (weak, nonatomic) IBOutlet UILabel *startLabel;
@property (weak, nonatomic) IBOutlet UILabel *endLabel;

- (IBAction)addToCalendar:(id)sender;

@end
Loading

0 comments on commit 7fbb87b

Please sign in to comment.