Dictionary
struct Dictionary<Key : Hashable, Value> : Collection, ExpressibleByDictionaryLiteral
-
Checks for the existence of a key
Parameter
Parameter key: the key you are looking for
Returns
BoolDeclaration
Swift
public func has(key: Key) -> BoolParameters
keythe key you are looking for
Return Value
Bool -
Converts the dictionary into a string
Format:
"key":"value","key2":"value2"Returns
aStringrepresentation of theDictionaryDeclaration
Swift
public func toString() -> StringReturn Value
a
Stringrepresentation of theDictionary -
Converts the
Dictionaryinto a JSON formatted stringReturns
aStringrepresentation of the JSONifiedDictionaryDeclaration
Swift
public func toJSONString() -> String?Return Value
a
Stringrepresentation of the JSONifiedDictionary -
Converts each value into a
Stringand returns anArray<String>Returns
anArray<String>of theDictionaryvaluesDeclaration
Swift
public func toStringArray() -> Array<String>Return Value
an
Array<String>of theDictionaryvalues
Dictionary Extension Reference