I'm trying to get access to a user's calendars via EventKit using Swift 2. In digging around online, I've found a few examples showing similar implementations to this answer on another SO question.
The error I keep hitting is
Use of unresolved identifier 'EKEntityTypeEvent'
In my viewDidLoad() -
let eventStore = EKEventStore()
switch EKEventStore.authorizationStatusForEntityType(EKEntityTypeEvent) {
case .Authorized:
insertEvent(eventStore)
case .Denied:
print("Access denied")
case .NotDetermined:
eventStore.requestAccessToEntityType(EKEntityTypeEvent, completion:
{[weak self] (granted: Bool, error: NSError!) -> Void in
if granted {
self!.insertEvent(eventStore)
} else {
print("Access denied")
}
})
default:
print("Case Default")
}
Any ideas on this error?
I'm running El Capitan / XCode 7 Beta 3.