Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
struct ContentView: View {
@AppStorage(wrappedValue: false, "enabled_preference") var enabled_preference
var body: some View {
NavigationView {
Text("The toolbar is displayed in conjunction with the switch On/Off in the Settings application - Third Party Application Settings - Sample Application Settings.\n\nNote: The AppStorage value will revert to its initial value after each app transfer after the build, so build carefully.")
.toolbar {
ToolbarItemGroup(placement: .bottomBar) {
if enabled_preference {
Button("Log") {
.navigationTitle("AppStorage example")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment