Instance Method


Sets the dictionary for the specified persistent domain.


func setPersistentDomain(_ domain: [String : Any], forName domainName: String)



The dictionary of keys and values you want to assign to the domain.


The domain whose keys and values you want to set. This value should be equal to your application's bundle identifier.


When a persistent domain is changed, an didChangeNotification is posted.

See Also

Maintaining Persistent Domains

func synchronize()

Writes any modifications to the persistent domains to disk and updates all unmodified persistent domains to what is on disk.

func persistentDomain(forName: String)

Returns a dictionary containing the keys and values in the specified persistent domain.

func removePersistentDomain(forName: String)

Removes the contents of the specified persistent domain from the user’s defaults.