Answers for "dictionary contains value at key swift code example"

1

swift dictionary contains key

if let value = self.dictionary["key"] {
	print(value) // prints value
}

// OR
extension Dictionary {
  func contains(key: Key) -> Bool {
    self[key] != nil
  }
}
Posted by: Guest on June-07-2021

Code answers related to "dictionary contains value at key swift code example"

Code answers related to "Swift"

Browse Popular Code Answers by Language