eventkit

Attach iCal File in MFMailComposerController?

点点圈 提交于 2019-12-08 11:52:09
问题 I want to add Event in my iPhone Calendar , i Successfully add the Event in my iPhone calendar. But, i want to get the all Current Month event and i want to attach that Event file (.ical) in my MFMailComposer . 回答1: Reading events is very simple. // Create the predicate from the event store's instance method NSPredicate *predicate = [store predicateForEventsWithStartDate:startOfTheMonth endDate:endOfTheMonth calendars:nil]; // Fetch all events that match the predicate NSArray *events = [store

Swift EKCalendar not persisting

只谈情不闲聊 提交于 2019-12-08 07:00:31
问题 I can create a new calendar and save it with the following function: func createCalendarForUser() { let sourcesInEventStore = self.eventStore.sources //works but doesn't persist let subscribedSourceIndex = sourcesInEventStore.index {$0.title == "Subscribed Calendars"} if let subscribedSourceIndex = subscribedSourceIndex { let userCalendar = EKCalendar(for: .event, eventStore: self.eventStore) userCalendar.title = "newCalendar" userCalendar.source = sourcesInEventStore[subscribedSourceIndex]

Reorder EKReminder in a list

橙三吉。 提交于 2019-12-07 07:22:03
问题 Is it possible to reorder EKReminders in EKCalendar of type reminders? In native Reminders app it is possible, but I can't seem to find this option in the API. 回答1: So, EKCalendarItem objects have calendarItemExternalIdentifier which is unique to the event across devices. You can use this to your advantage for this ordering strategy. Every time you fetch events from the calendar API, keep track of their calendarItemExternalIdentifier in whatever persistence store you choose (Core Data, SQLite

How to decide whether the default EKCalendar 'Calendar' can be hidden?

夙愿已清 提交于 2019-12-06 22:46:46
问题 I'm writing an app that deals with calendars. In the app I'm displaying a list of all available calendars for the user to enable or disable. I'm not using the EventKitUI framework for purposes of my own design and UI. I get a neat list of calendars by polling the calendars property of an EKEventStore object. On my device, however, there's an EKCalendar object in that list that is not shown by the EKEventKitUI . This is a description of the object in the debugger: EKCalendar <0xcea6b60> {title

Create a calendar in iOS [closed]

淺唱寂寞╮ 提交于 2019-12-06 14:13:21
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 2 years ago . I have an app which I need to create a calendar to save events that are created by said application. The calendar should be used only inside the app but could have the option to sync to the default calendar. Searched tutorials but none explain this process in a very good way, so

Add a new calendar to an EKEventStore with EventKit [closed]

被刻印的时光 ゝ 提交于 2019-12-06 10:29:35
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . How can I add a Calendar (not an event) to a EKEventStore in iOS 5? 回答1: I caught an exception unless I also did: // Get the calendar source EKSource* localSource; for (EKSource* source in eventStore.sources) { if (source.sourceType == EKSourceTypeLocal) { localSource = source; break; } } if (!localSource)

Swift 4 How to get all events from calendar?

橙三吉。 提交于 2019-12-06 09:38:39
问题 I am using Swift 4.1. And I want to write a function which will collect all events from all calendars in Calendar app of iOS. Thanks to this answer on stackoverflow: How to get all Events out of a Calendar (Swift) I was able to write my own class and call it Cale . Please, look at this: import UIKit import EventKit class Cale { private func createDate(year: Int) -> Date { var components = DateComponents() components.year = year components.timeZone = TimeZone(secondsFromGMT: 0) return Calendar

Failing to save EKReminder in iOS 6

偶尔善良 提交于 2019-12-06 06:20:14
问题 I am trying to save/ retrieve reminders from my app, but for some reason the EKReminder seems as though it is not being saved. Here is my code: EKEventStore * _eventStore = [[EKEventStore alloc] init]; [_eventStore requestAccessToEntityType:EKEntityTypeReminder completion:^(BOOL granted, NSError *error) { //create a new calendar for reminders. EKCalendar *calendar = [EKCalendar calendarForEntityType:EKEntityTypeReminder eventStore:_eventStore]; EKSource *localSource = nil; for (EKSource

URL Scheme for opening the iCal app at a date or event?

▼魔方 西西 提交于 2019-12-06 04:30:58
问题 The Apple URL Scheme Reference gives a nice overview of a number of URL schemes you can use to open certain built-in apps with some parameters. I know that this is not a complete list of all possible URL schemes that the built-in apps respond to, since there are also ways to open the system settings at various pages. The website http://handleopenurl.com is a nice attempt at gathering all possible URL schemes and it has quite a few built-in apps on there. One app I would like to open with a

How to set a reminder(alarm) using eventKit framework for a particular date

岁酱吖の 提交于 2019-12-06 02:08:05
问题 I am working with EventKit framework in iOS 5 and I successfully added an event to the iOS calendar using the below code EKEventStore *eventDB = [[EKEventStore alloc] init]; EKEvent *myEvent = [EKEvent eventWithEventStore:eventDB]; myEvent.title = @"New Event"; myEvent.startDate = [[NSDate alloc] init]; myEvent.endDate = [[NSDate alloc] init]; myEvent.allDay = YES; [myEvent setCalendar:[eventDB defaultCalendarForNewEvents]]; Now How shall i added an alarm (reminder) for this event ? Thanks