Skip to content

Instantly share code, notes, and snippets.

@jordansinger
Created July 7, 2020 13:56
Show Gist options
  • Save jordansinger/b3da12f1ef14b677248739ade3a98c73 to your computer and use it in GitHub Desktop.
Save jordansinger/b3da12f1ef14b677248739ade3a98c73 to your computer and use it in GitHub Desktop.
import SwiftUI
import PlaygroundSupport
struct SignUpView: View {
@State var username = ""
@State var password = ""
var body: some View {
NavigationView {
Form {
Section {
TextField("Username", text: $username)
SecureField("Password", text: $password)
}
NavigationLink(destination: WelcomeView()) {
Text("Sign up")
}
}
.navigationBarTitle("Sign up")
}
.accentColor(.primary)
.navigationViewStyle(StackNavigationViewStyle())
}
}
struct WelcomeView: View {
var body: some View {
VStack(spacing: 20) {
Image(systemName: "checkmark.circle.fill")
.font(.largeTitle)
.foregroundColor(.green)
Text("Welcome")
.font(.title)
}
}
}
PlaygroundPage.current.setLiveView(SignUpView())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment