Instance Method

setDictionary(_:)

Sets the contents of the receiving dictionary to entries in a given dictionary.

Declaration

func setDictionary(_ otherDictionary: [AnyHashable : Any])

Parameters

otherDictionary

A dictionary containing the new entries.

Discussion

All entries are removed from the receiving dictionary (with removeAllObjects()), then each entry from otherDictionary added into the receiving dictionary.

See Also

Adding Entries to a Mutable Dictionary

func setObject(Any, forKey: NSCopying)

Adds a given key-value pair to the dictionary.

func setValue(Any?, forKey: String)

Adds a given key-value pair to the dictionary.

func addEntries(from: [AnyHashable : Any])

Adds to the receiving dictionary the entries from another dictionary.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software