Created
April 20, 2019 12:31
-
-
Save KanshuYokoo/95ccff4d34c128f3075484930f649271 to your computer and use it in GitHub Desktop.
NSMutableDictionary is Key value pair existing the dictionary. swit
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 NSMutableDictionary { | |
func isExist(forKey key: String) -> Bool { | |
return self[key] != nil | |
} | |
func isKeyValue<T: Equatable> (value: T, forKey key: String) -> Bool { | |
if(!isExist(forKey: key)){ | |
return false | |
} | |
let val = self[key] as! T | |
return val == value | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment