I'm attempting to set up an EKEventStore to (with their permission) display the user's calendar events in an iOS app.
The first couple of Apple documentation pages that I've come across on how to initialize the EKEventStore instance (1. Accessing the Event Store; 2. Reading and Writing Calendar Events) say to do so like this:
EKEventStore *eventStore = [[EKEventStore alloc] initWithAccessToEntityTypes:EKEntityMaskEvent];
However, in a fresh iOS application created using the latest Xcode (version 11.3) with the "Single Page Application" template, with the above line of code added to the viewDidLoad
method of the ViewController.m, Xcode gives this error:
'initWithAccessToEntityTypes' is unavailable: not available on iOS
What's the correct way to initialize EKEventStore
in an iOS app?