Skip to content

Instantly share code, notes, and snippets.

@TuenTuenna
Created January 9, 2022 03:30
Show Gist options
  • Save TuenTuenna/22f1793b43268ea9acdd5a921655ebf8 to your computer and use it in GitHub Desktop.
Save TuenTuenna/22f1793b43268ea9acdd5a921655ebf8 to your computer and use it in GitHub Desktop.
swiftui_dummy_form

더미 입력 폼

import Foundation
import SwiftUI

struct SomeFormView : View {

    
    @State var nameInput: String = ""
    @State var emailInput: String = ""
    @State var passwordInput: String = ""
    @State var passwordConfirmInput: String = ""
    
    var body: some View{
        
            VStack{
                Form {
                    Section(header: Text("이름")) {
                        TextField("이름을 입력해주세요", text: $nameInput).keyboardType(.default).autocapitalization(.none)
                    }
                    Section(header: Text("이메일")) {
                        TextField("이메일", text: $emailInput).keyboardType(.emailAddress).autocapitalization(.none)
                    }
                    Section(header: Text("비밀번호")) {
                        SecureField("비밀번호", text: $passwordInput).keyboardType(.default)
                        SecureField("비밀번호 확인", text: $passwordConfirmInput).keyboardType(.default)
                    }
                    Section{
                        Button {
                            print("회원가입 버튼 클릭")
                        } label: {
                            Text("회원가입하기")
                        }
                    }
                }
            }// VStack
            .navigationTitle("회원가입")
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment