Initializer

init(dictionary:)

Initializes a newly allocated dictionary by placing in it the keys and values contained in another given dictionary.

Declaration

convenience init(dictionary otherDictionary: [AnyHashable : Any])

Parameters

otherDictionary

A dictionary containing the keys and values with which to initialize the new dictionary.

Return Value

An initialized dictionary—which might be different than the original receiver—containing the keys and values found in otherDictionary.

See Also

Creating a Dictionary from Another Dictionary

init(dictionary: [AnyHashable : Any], copyItems: Bool)

Initializes a newly allocated dictionary using the objects contained in another given dictionary.

init(dictionaryLiteral: (Any, Any)...)

Initializes a newly allocated dictionary from the given key-value pairs.