I created an app that is mainly used by a Today Extension. It has to have access to the calendar because the widget displays upcoming events. Now I want the "host app" to have a list of all the users calendars and lets the user decide which calendars the widget should consider getting the events from.
My understanding is that the EKEventStore() initializer should not be called multiple times (by the widget and the host app in this example). Is there an easy way to only ask once for the permission to use the calendar (regardless whether the user first interacts with the host app or the widget) and share the permissions or do I have to check for permission in both the widget and the host app? Also, how should I ideally deal with using the EKEventStore() initializer in both the widget and the app?
To answer the questions for future reference: This is my solution to the problem of only writing the code to check for calendar access once. I created an extension of EKEventStore class which lets me call a function which returns the status as a boolean. This makes usage of this in different targets much more clean
Thanks to dan for the answer regarding multiple instances of EKEventStore