Created
July 27, 2023 23:27
-
-
Save fdstevex/9476c6dd83810a9ae8a22a16de8768ce 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 Settings { | |
static var documentSelected = false | |
} | |
struct FolderPage: View { | |
@State var documentsLabel: String = Settings.documentSelected ? "Selected" : "Not selected" | |
var body: some View { | |
VStack { | |
VStack { | |
if !Settings.documentSelected { | |
Text("Not selected yet") | |
} else { | |
Text("Selected folder:") | |
Text(documentsLabel) | |
.font(.title) | |
} | |
Button(action: { | |
documentsLabel = "New Value" | |
Settings.documentSelected = true | |
}, label: { | |
Text("Select Folder") | |
}) | |
} | |
}.padding(30) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment