Contents

set(_:forKey:)

Sets the value of the specified key to a floating-point number.

Declaration

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

Parameters

  • value:

    The floating-point value to store in the defaults database.

  • defaultName:

    The key that contains the setting’s name.

Discussion

This method places the floating-point 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