Search code examples
iosswiftiniteventkitreminders

error message 'init(accessToEntityTypes:)' is unavailable intializing EKEventStore


I am following the instructions to initialize EKEventStore in this documentation, but I get a code time error at the following line:

let eventStore = EKEventStore(accessToEntityTypes: .reminder)

The error message says:

'init(accessToEntityTypes:)' is unavailable


Solution

  • That document is wrong. If you look at https://developer.apple.com/documentation/eventkit/ekeventstore you will find no such initializer. It once existed on MacOS but never on iOS. Just call EKEventStore().