Contents

init(_:store:)

Creates a property that can read and write an Optional boolean user default.

Declaration

init(_ key: String, store: UserDefaults? = nil) where Value == Bool?

Parameters

  • key:

    The key to read and write the value to in the user defaults store.

  • store:

    The user defaults store to read and write to. A value of nil will use the user default store from the environment.

Discussion

Defaults to nil if there is no restored value.

See Also

Storing a value