You want to add events or make other changes to the user’s calendar, but this requires the user to give your app permission.
authorizationStatusForEntityType: class method
EKEventStore class and pass
one of the following values to it as its parameter:
Permission to access/add/delete/modify events in the user’s calendars.
Permission to access/add/delete/modify reminders in the user’s calendars.
The method returns one of the following values:
Your app is authorized to access the given type of items (events or reminders).
The user has previously denied your app’s access to the event store, and this remains in force.
Your app has not attempted to access the event store before,
so the user has not been asked to grant or reject permission. In
this case, you need to ask for permission from the user to access
the event store on her device using the
instance method of the
Due to some other restrictions on the device, such as parental controls, your app cannot access the event store on the device.
Here is a code snippet that will handle all these cases for us: