Creates a user defaults object initialized with the defaults for the specified user account.


convenience init?(user username: String)



The name of the user account.

Return Value

An initialized UserDefaults object whose argument and registration domains are already set up. If the current user does not have access to the specified user account, this method returns nil.


This method doesn't put anything in the search list. Invoke it only if you’ve allocated your own UserDefaults instance instead of using the shared one.

You do not normally use this method to initialize an instance of UserDefaults. Applications used by a superuser might use this method to update the defaults databases for a number of users. The user who started the application must have appropriate access (read, write, or both) to the defaults database of the new user, or this method returns nil.

Special Considerations

This method was never implemented to do anything except return the defaults for the current user.

See Also


func synchronize() -> Bool

Waits for any pending asynchronous updates to the defaults database and returns; this method is unnecessary and shouldn't be used.

class func resetStandardUserDefaults()

This method has no effect and shouldn't be used.