If you want to gain access to your calendar events it’s time to use EventKit. EventKit allows you to do multiple operations with calendar events and reminders. In this post I will cover gaining access to existing events in your calendar.
In order to get desired access you need to follow a few basic steps.
Your app needs to gain access to calendar. This code will show the alert to a user when app is opened for the first time. You can always change it in app’s settings later on.
Getting a list of calendars available on your device. Using this method you will get an array of ‘EKCalendar’ type objects.
Getting events from your calendars. This way you get array of EKEvent objects describing events in your calendar.