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

    Bool

    Declaration

    Swift

    public func has(key: Key) -> Bool

    Parameters

    key

    the key you are looking for

    Return Value

    Bool

  • Converts the dictionary into a string

    Format: "key":"value","key2":"value2"

    Returns

    a String representation of the Dictionary

    Declaration

    Swift

    public func toString() -> String

    Return Value

    a String representation of the Dictionary

  • Converts the Dictionary into a JSON formatted string

    Returns

    a String representation of the JSONified Dictionary

    Declaration

    Swift

    public func toJSONString() -> String?

    Return Value

    a String representation of the JSONified Dictionary

  • Converts each value into a String and returns an Array<String>

    Returns

    an Array<String> of the Dictionary values

    Declaration

    Swift

    public func toStringArray() -> Array<String>

    Return Value

    an Array<String> of the Dictionary values