Skip to content

Instantly share code, notes, and snippets.

@KanshuYokoo
Created April 20, 2019 12:31
Show Gist options
  • Save KanshuYokoo/95ccff4d34c128f3075484930f649271 to your computer and use it in GitHub Desktop.
Save KanshuYokoo/95ccff4d34c128f3075484930f649271 to your computer and use it in GitHub Desktop.
NSMutableDictionary is Key value pair existing the dictionary. swit
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