Created
August 27, 2020 19:49
-
-
Save acwright/ae9eb1c16cc9732e88d2b0f4e04de697 to your computer and use it in GitHub Desktop.
ContentView
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 { | |
@State private var document: MessageDocument = MessageDocument(message: "Hello, World!") | |
@State private var isImporting: Bool = false | |
@State private var isExporting: Bool = false | |
var body: some View { | |
VStack { | |
GroupBox(label: Text("Message:")) { | |
TextEditor(text: $document.message) | |
} | |
GroupBox { | |
HStack { | |
Spacer() | |
Button(action: { isImporting = true }, label: { | |
Text("Import") | |
}) | |
Spacer() | |
Button(action: { isExporting = true }, label: { | |
Text("Export") | |
}) | |
Spacer() | |
} | |
} | |
} | |
.padding() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment