swift 5 check for key in code example Example: swift check dictionary has key let hasKey = myDictionary.keys.contains("myKey")