Created
February 24, 2021 05:24
-
-
Save notoroid/b26ed6506a6347ea0a8ad436d6b7b6fd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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