Skip to content

Instantly share code, notes, and snippets.

@acwright
Created August 27, 2020 19:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save acwright/ae9eb1c16cc9732e88d2b0f4e04de697 to your computer and use it in GitHub Desktop.
Save acwright/ae9eb1c16cc9732e88d2b0f4e04de697 to your computer and use it in GitHub Desktop.
ContentView
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