ekeventstore

How to use requestAccessToEntityType method in Swift iOS 8

我们两清 提交于 2019-12-05 13:07:13
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 in Swift? Try this please: func handler(granted: Bool, error: NSError!) { // put your handler code here

Creating an EKCalendar in EKEventStore - Swift

我与影子孤独终老i 提交于 2019-12-04 19:47:01
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. 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 = eventStore.calendarsForEntityType(EKEntityTypeReminder) if(yourReminderCalendar == nil) { for calendar in calendars

Deleting an EKEvent from device's calendar using its identifier

冷暖自知 提交于 2019-12-04 19:14:38
I am creating EKEvent, saving it and saving its identifier as well. I wanna access this identifier and delete the specific Event. I am able to retrieve the proper Identifier from database. However, the Event isn't getting deleted from my Device's calendar. My code to delete the event : `NSError* err; EKEvent *myEvent = [EKEvent eventWithEventStore:homeobj.eventDB]; myEvent = [homeobj.eventDB eventWithIdentifier:[dbObj selectEventIdentifier:mypass]]; [homeobj.eventDB removeEvent:myEvent span:EKSpanThisEvent commit:YES error:&err]; ` For deleting use this code -(void)removeMeWithIndex:(int)index

Adding a new calendar programmatically to calendar app if user is using non iOS account

非 Y 不嫁゛ 提交于 2019-12-04 03:47:35
问题 Can we add a new calendar to default calendar app programmatically if user is using any other account for calendars like yahoo or hotmail, I am getting following error: Domain=EKErrorDomain Code=17 "That account does not allow calendars to be added or removed." Code works perfectly fine if user is using icould or ios calendars 回答1: Finally after a lot of research for few days , i found that Some EKExchange calendars like google , yahoo does not allow us to add events in their calendars . And

How to detect which EKevent was changed

送分小仙女□ 提交于 2019-12-03 21:29:20
问题 I got the problem. I need to know when Events in my EventStore are changed, so for this case I use EKEventStoreChangedNotification but this notification return to me incomprehensible dictionary in userInfo It's look like this: EKEventStoreChangedObjectIDsUserInfoKey = ("x-apple-eventkit:///Event/p429" ); I don't know how I can use this data to taking access for changed object. Please help me 回答1: This will detect changed events and log the event titles over a date range. Although, I ended up

Error while implementing Sandbox: “deny file-read-metadata /Library”

左心房为你撑大大i 提交于 2019-12-03 06:17:19
I realize that I'm a bit late to the game here in getting sandbox-ready, but so it goes. I'm developing for OS X 10.9. The app displays Calendar event data, but does not allow editing, so I have enabled the Calendars capability. The app works great with sandboxing enabled when I run it from Xcode, but when I export it signed with Developer ID, the app runs, but can't access the Calendar data. What's more, the system never asks me to allow the app to access Calendar data. When I run the app, it launches, but doesn't show any data. In Console, sandboxd throws a bunch of errors that look like

Save event to user's calendar

与世无争的帅哥 提交于 2019-12-01 15:48:11
How do you add an event to the user's calendar, but then allow the user to choose the calendar, etc. I have this code that works, but this adds the event to the user's default calendar. How do I allow the user to change the calendar, customize the alerts etc? I have seen other apps open the calendar app and pre-fill the fields. //add to calendar let eventStore : EKEventStore = EKEventStore() eventStore.requestAccessToEntityType(EKEntityType.Event, completion: { (granted, error) in if granted && error == nil { let event:EKEvent = EKEvent(eventStore: eventStore) event.title = "My event: " + self

Save event to user's calendar

北战南征 提交于 2019-12-01 15:43:09
问题 How do you add an event to the user's calendar, but then allow the user to choose the calendar, etc. I have this code that works, but this adds the event to the user's default calendar. How do I allow the user to change the calendar, customize the alerts etc? I have seen other apps open the calendar app and pre-fill the fields. //add to calendar let eventStore : EKEventStore = EKEventStore() eventStore.requestAccessToEntityType(EKEntityType.Event, completion: { (granted, error) in if granted

iOS EventKit - Event is not being deleted from calendar

痞子三分冷 提交于 2019-12-01 11:12:55
I'm deleting event using the following code [store requestAccessToEntityType:EKEntityTypeEvent completion: ^(BOOL granted, NSError *error) { if (granted) { EKEvent *event = [store eventWithIdentifier:eventIdentifier]; NSError *eventDeleteError = nil; if (event) { [store removeEvent:event span:EKSpanThisEvent error:&eventDeleteError]; } if (eventDeleteError) { NSLog(@"Event Deletion Error: %@", eventDeleteError); } }]; I got no error in eventDeleteError but following message appear in the console log CADObjectGetInlineStringProperty failed fetching UUID for EKPersistentAttendee with error Error

UIAlertView takes a long time to appear when called in a completion block

被刻印的时光 ゝ 提交于 2019-12-01 09:08:28
Part of my app requires calendar access, which requires a call to the EKEventStore method -(void)requestAccessToEntityType:(EKEntityType)entityType completion:(EKEventStoreRequestAccessCompletionHandler)completion as of iOS 7. I added the request, and everything runs smoothly if the user selects to allow access, but a problem arises if the user denies or has previously denied access. I added a UIAlertView to notify the user if access is denied, but the UIAlertView consistently takes 20-30 seconds to appear, and completely disables the UI during that time. Debugging has shown that [alertView