Instance Method

setPersistentDomain(_:forName:)

Sets the dictionary for the specified persistent domain.

Declaration

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

Parameters

domain

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

domainName

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

Discussion

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.