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
nilwill use the user default store from the environment.
Discussion
Defaults to nil if there is no restored value.