Contents

set(_:forKey:)

Sets the value of the specified key to a Boolean value.

Declaration

func set(_ value: Bool, forKey defaultName: String)

Parameters

  • value:

    The Boolean value to store in the defaults database.

  • defaultName:

    The key that contains the setting’s name.

Discussion

This method places the Boolean value in an NSNumber type before writing the key and value to the defaults database. After you call this method, the system generates a didChangeNotification for registered observers.

See Also

Setting the value for a key