Swift Check Dictionary tiene clave
let hasKey = myDictionary.keys.contains("myKey")
Adventurous Anteater
let hasKey = myDictionary.keys.contains("myKey")
if let value = self.dictionary["key"] {
print(value) // prints value
}
// OR
extension Dictionary {
func contains(key: Key) -> Bool {
self[key] != nil
}
}