So you have event information that you want to put into a calendar on iOS. Let’s say you have a local struct that keeps track of events your app manages, like football games.
Perhaps you’ve got a button in your interface that lets a user add any football game to their favorites list, and when they do you’ll try adding it to their calendar as well.
First we’ll get our authorization status for working with calendar events. From there we’ll ask the user for permission to work with their calendar if we’ve never done so before. Once we have authorization, then the fun begins.
We’ll create a calendar event from our own event struct and then present a view controller that will let the user edit and save it to the calendar of their choice.
That will show the user our event data and let them choose how to edit it before saving the event to the calendar of their choice.
Once the user saves the event to their calendar, we’ll get a callback.
Later we can delete the event from their calendar using the identifier we saved. To simplify, I’ve left the authorization checks out of this method.
Those are the basics of taking the custom event data from your app and adding them to the user’s calendar.
What kind of events are you saving? Leave a comment below to let me know.