eventkit

How to use requestAccessToEntityType method in Swift iOS 8

三世轮回 提交于 2020-01-02 05:23:37
问题 I'm trying to get a list of events by using EKEventStore using Swift in iOS8, and the documentation is not updated yet as far as I can tell. This is what I'm trying to do: let eventStore = EKEventStore() eventStore.requestAccessToEntityType(EKEntityType(), EKEventStoreRequestAccessCompletionHandler(Bool(), NSError(){})) This is the error I get: 'EKEventStoreRequestAccessCompletionHandler' is not constructible with '(Bool, NSError) Do you know how can I use the method or the handler correctly

Creating an EKCalendar in EKEventStore - Swift

雨燕双飞 提交于 2020-01-01 19:27:10
问题 I'm trying to create a single calendar into EKEventStore when the my app first runs. I found this tutorial but I don't really know enough about Objective-C to translate it to Swift, and also from the research that I've done I'm wondering if this method is still possible in ios8. 回答1: Try (note this is for a reminder type, but you can just change the type if you need to): let eventStore = EKEventStore() var yourReminderCalendar: EKCalendar? func retrieveYourCalendar() { let calendars =

EKEvent eventIdentifier returns null

这一生的挚爱 提交于 2020-01-01 10:04:25
问题 When I try to get the identifier of an EKEvent, all I get is a nil value. Since in iOS5 EKEvent is a subclass of EKCalendarItem, I figured I might be able to get the EKCalendarItem's UUID, but that returns nil as well. Every now and then I also get this error while trying to access the identifier or UUID property: CADObjectGetInlineStringProperty failed fetching uniqueID for EKPersistentEvent with error Error Domain=NSMachErrorDomain Code=268435459 "The operation couldn’t be completed. (Mach

Deleting reminders from calendar in Swift

人盡茶涼 提交于 2019-12-25 05:48:10
问题 I use the following function to retrieve my calendar: func retrieveCalendar() -> EKCalendar? { appDelegate = UIApplication.sharedApplication().delegate as? AppDelegate var myCalendar: EKCalendar? let calendars = appDelegate!.eventStore!.calendarsForEntityType(EKEntityTypeReminder) as! [EKCalendar] let filteredCalendars = calendars.filter {$0.title == "MedicalCalendar"} if filteredCalendars.isEmpty { println("could not find reminder calendar 'MedicalCalendar'") return nil } else { myCalendar =

iOS7 - device restaring when copying 500 records to eventstore with Commit=YES

半世苍凉 提交于 2019-12-24 15:35:44
问题 The below code will work fine with 500 records, we are batching the operation and commit the eventstore after adding 500 records. EKEventStore *eventStore = [[EKEventStore alloc] init]; for(int i=0 ; i< 500 ; i++){ EKCalendar *calendarDef = [eventStore defaultCalendarForNewEvents]; EKEvent *event = [EKEvent eventWithEventStore:eventStore]; [event setCalendar:calendarDef]; //set values to this event. like title, notes, startDate, endDate, location event.title = [NSString stringWithFormat:@

Daylight Saving Time Bug in EventKit

℡╲_俬逩灬. 提交于 2019-12-24 09:27:08
问题 I discovered a bug in eventKit where dates are altered when saving. In this sample, I use an event with title Midnight that is a 1 second long event calculated to be local astronomical midnight. In the local timeZone, there are two occurrences of 1AM to 2AM in locale format because of daylight saving time ending. The event occurs in the second instance of 1AM to 2AM. See this sample code: if ([event.title containsString:@"Midnight"]) { NSLog(@"Timezone is %@",[NSTimeZone localTimeZone]);

Batch saving EKEvents to Google calendar causing loss of random events

♀尐吖头ヾ 提交于 2019-12-24 03:22:33
问题 I have a large set of activities that I want to batch save to the calendar. Which calendar is selected by the user. They have the option to export to iCloud calendar or Google calendar. When exporting to iCloud calendar everything runs smoothly. No problems. However, when exporting to Google calendar I am encountering som weird issues. The number of events to be saved is somewhere around 60-90 events. I use the function provided below to export the calendar events in the background. The

EKEvent accept invitation

删除回忆录丶 提交于 2019-12-23 08:28:28
问题 How do you accept an EKEvent invitation in iOS? I know it's possible as Fantastical , Calendars 5 , and other calendar apps have this functionality, but I don't see an exposed non read-only property to change the user's status in regards to an event. Any idea how to do this? Thanks, 回答1: Turns out, after doing some more research, that all of these apps are just displaying the EKEventViewController . What I had mistaken as customization was actually view tints. 来源: https://stackoverflow.com

iOS – Event Kit programming listen to notifications

流过昼夜 提交于 2019-12-21 21:25:23
问题 I want to observe changes to the Calendar application so I register for the EKEventStoreChangedNotification notification. But do I need to have an EKEventStore object "alive" for me to receive this notification? I'm thinking I'm initializing the EKEventStore object in on view controller to retrieve some events. And then I will pop this view controller of the navigation stack and the view controller will be deallocated thus the EKEventStore object will be deallocated. 回答1: No, you don't need

EventKit in Universal app (OS3.2)

淺唱寂寞╮ 提交于 2019-12-21 20:59:08
问题 I made iPhone app with eventkit framework. However, i upgrade to universal app, app can't run in ipad. I got error message dyld: Library not loaded: /System/Library/Frameworks/EventKit.framework/EventKit Yes, event kit only work for iOS 4.0 or later. So, how to make it for universal. I want to make , if iPad app, don't use event kit framework. However, I can't add #import <EventKit/EventKit.h> #import <EventKitUI/EventKitUI.h> in run time 回答1: You need to do two things: First, weak link