Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Persist state via AppStorage #98

Open
alaneuler opened this issue Apr 29, 2023 · 0 comments
Open

Persist state via AppStorage #98

alaneuler opened this issue Apr 29, 2023 · 0 comments

Comments

@alaneuler
Copy link

alaneuler commented Apr 29, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant