Is there any way to add iCal event to the iPhone Calendar from the custom App?
相关问题
- CALayer - backgroundColor flipped?
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- how do you prevent page scroll in textarea on mobi
- Custom UITableview cell accessibility not working
相关文章
- Could I create “Call” button in HTML 5 IPhone appl
- Unable to process app at this time due to a genera
- How do you detect key up / key down events from a
- “Storyboard.storyboard” could not be opened
- Open iOS 11 Files app via URL Scheme or some other
- Can keyboard of type UIKeyboardTypeNamePhonePad be
- Can not export audiofiles via “open in:” from Voic
- XCode 4.5 giving me “SenTestingKit/SenTestKit.h” f
Simple.... use tapku library.... you can google that word and use it... its open source... enjoy..... no need of bugging with those codes....
Yes there still is no API for this (2.1). But it seemed like at WWDC a lot of people were already interested in the functionality (including myself) and the recommendation was to go to the below site and create a feature request for this. If there is enough of an interest, they might end up moving the ICal.framework to the public SDK.
https://developer.apple.com/bugreporter/
Based on Apple Documentation, this has changed a bit as of iOS 6.0.
1) You should request access to the user's calendar via "requestAccessToEntityType:completion:" and execute the event handling inside of a block.
2) You need to commit your event now or pass the "commit" param to your save/remove call
Everything else stays the same...
Add the EventKit framework and
#import <EventKit/EventKit.h>
to your code.In my example, I have a NSString *savedEventId instance property.
To add an event:
Remove the event:
This adds events to your default calendar, if you have multiple calendars then you'll have find out which one that is
Swift version
You need to import the EventKit framework
Add event
Remove event
Swift 4.0 implementation :
use import in top of page by
import EventKit
then
Remember to set the endDate to the created event, it is mandatory.
Otherwise it will fail (almost silently) with this error:
The complete working code for me is: