Find first element matching condition in Swift array (e.g. EKSource)
Alternatively in Swift4 you could use: let local = eventStore.sources.first {$0.sourceType == .Local}
Alternatively in Swift4 you could use: let local = eventStore.sources.first {$0.sourceType == .Local}
Based on Apple Documentation, this has changed a bit as of iOS 6.0. 1) You should request access to the user’s calendar via “requestAccessToEntityType:completion:” and execute the event handling inside of a block. 2) You need to commit your event now or pass the “commit” param to your save/remove call Everything else stays the same… … Read more