Skip to content

Instantly share code, notes, and snippets.

@huntercmeyer
Created October 2, 2021 15:08
Show Gist options
  • Save huntercmeyer/e83eba6959d52db16e697f63dfd5b7b4 to your computer and use it in GitHub Desktop.
Save huntercmeyer/e83eba6959d52db16e697f63dfd5b7b4 to your computer and use it in GitHub Desktop.
import Foundation
extension Dictionary {
func firstValue(where predicate: (Key, Value) -> Bool) -> Value? {
return self.first(where: predicate)?.value
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment