#appstorage #swiftui
The @AppStorage
property wrapper for observable access to UserDefaults
keys is stringified.
To get a strongly typed key access, I oriented myself on the @Environment(\.keyPath)
wrapper and my experience with SwiftyUserDefaults
and its subscript-based access.
// Use defaultValue from the key:
@AppStorage(\.showOnboarding) var showOnboarding