Search code examples
xcodeeventkitswift-playground

Access calendars in Playground


import EventKit

var store = EKEventStore()

store.requestAccessToEntityType(EKEntityTypeEvent) {
    (success: Bool, error: NSError!) in
    println("Got permission = \(success); error = \(error)")
}

I have the above code in a Playground and the response is...

Got permission = false; error = nil

How can I give permission to Playground?


Solution

  • Playgrounds don't support entitlements, which are required to access calendars/reminders.

    It's a real shame, as this would be a perfect way to play around with how you would like to use an API.