sindresorhus/Preferences
Do you want to work on this issue?
You can request for a bounty in order to promote it!
Persist state via AppStorage #98
alaneuler posted onGitHub
I want to persist the preferences user selected via AppStorage, however if I change the @State
to @AppStorage
, the UI will stuck after the toggling.
To reproduce the problem, change the isOn1
in AccountsScreen
to :
struct AccountsScreen: View {
@AppStorage("isOn1") private var isOn1 = true
....
}
then start the application, the first time toggle the "Permissions" is ok, but if trying to toggle it the second time, it just won't work and the toggle of "Permission" is stuck.