Created
November 4, 2020 12:00
-
-
Save laevandus/3e9538ed83acf1521bc8c234ef3f7b83 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 { | |
@StateObject var viewModel = ViewModel(package: .makeExample()) | |
var body: some View { | |
ScrollView { | |
VStack(spacing: 16) { | |
Text("Recipient") | |
.font(.headline) | |
InputView(title: "First name", | |
value: $viewModel.recipientFirstName) | |
InputView(title: "Last name", | |
value: $viewModel.recipientLastName) | |
Text("Address") | |
.font(.headline) | |
InputView(title: "Street", | |
placeholder: "e.g. 37 Christie St", | |
value: viewModel.street) | |
Text("Summary") | |
.font(.headline) | |
Text(viewModel.summary) | |
.frame(maxWidth: .infinity, alignment: .leading) | |
Button("Add item", action: viewModel.addRandomItem) | |
} | |
.padding() | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment