0

Been looking into EventKit but it seems to only create and immediately add the event into device calendar.

eventStore.save(event, span: .futureEvents)

The above code in swift immediately adds the event to the calendar.

The behaviour I'm currently looking for should create an event, given just the name and date of an event, present said event to the user, giving the user the option of pressing "Add to Calendar" before the event is actually added to calendar. This behaviour is equivalent to opening a link to a .ics (iCalendar format) file from a website, like so-

Example from http://www.eventfinda.co.nz/whatson/events/auckland

Any help will be greatly appreciated!

rgggr
  • 1
  • 1
  • It is unclear on what is the exact problem, reading data from the .ics file and then add the event based on the read data. – Sachin Vas Jan 31 '17 at 04:36
  • Thanks for the response. I've edited my question to hopefully make it more clear. iOS natively handles opening of .ics files when one clicks on a link to an .ics file on a webpage. I would like to replicate that behaviour within an app- given just the name and date of an event, create but not add the event. EDIT: I do not have an .ics file to read – rgggr Jan 31 '17 at 04:56
  • You need to add the event to the database so that it is visible in the calendar, and then remove if the user doesn't want to `add it to the calendar`. At the same time, to avoid committing the changes immediately use this link https://developer.apple.com/reference/eventkit/ekeventstore/1507295-save. – Sachin Vas Jan 31 '17 at 05:29
  • At this point after saving but not committing the event, is there a way to call iOS to show the added event detail (like the screenshot), or is that a view that has to be created and handled within the app? I tried searching up on this but to no avail. Thanks a lot so far – rgggr Jan 31 '17 at 05:49
  • http://stackoverflow.com/questions/997779/is-there-any-ready-made-calendar-control-for-iphone-apps There are so many different framework for this. – Sachin Vas Jan 31 '17 at 05:55

0 Answers0