Created
June 3, 2016 15:10
-
-
Save victoraugustolls/0a6979ab72a19af84679571dfdf93208 to your computer and use it in GitHub Desktop.
Swift dictionary type extension.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension Dictionary where Value : Equatable { | |
func allKeysForValue(val : Value) -> [Key] { | |
return self.filter { $1 == val }.map { $0.0 } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment