Find first element matching condition in Swift array (e.g. EKSource) May 9, 2023 by Tarik Alternatively in Swift4 you could use: let local = eventStore.sources.first {$0.sourceType == .Local}