iPhone Event Kit : programmatically create a EKCalendar?

前端 未结 3 977
旧时难觅i
旧时难觅i 2020-12-29 14:47

I would like to insert events in my app, so they can be viewed in iPhone Calendar.app. But since I don\'t want to mix the user events with those from my app, I wanted to cre

3条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-29 15:14

    Do you (or anyone else) have any progress with adding a new Calendar?

    I've got the same situation. I can programmatically add events to the default calendar perfectly well, but I'd like to add them to a new calendar, so they don't interfere with the users exsisting events, and can be easily deleted/hidden by the user instead of removing all events manually.

    You can't set the properties for a new EKCalendar object. It looks like you can only assign an exsiting one like defaultCalendarForNewEvents to an EKCalendar object.

    However, I know it's possible to programmatically create a new calendar, because I've seen iPhone app doing this (without leaving the app).

    • Could it be that they use a workaround by doing some trick with an external ICS file?
    • Maybe it is possible to do this by "subscribing" to a local (on the iPhone/app filesystem) generated ICS file, instead of an URL. Does anyone have any experience with this?

提交回复
热议问题