Skip to content

Instantly share code, notes, and snippets.

Embed
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.")
.padding()
.toolbar {
ToolbarItemGroup(placement: .bottomBar) {
if enabled_preference {
Spacer()
Button("Log") {
}
}
}
}
.navigationTitle("AppStorage example")
}
.navigationBarTitleDisplayMode(.inline)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment