Skip to content

Instantly share code, notes, and snippets.

@joeyabanks
Last active September 1, 2020 03:29
Show Gist options
  • Select an option

  • Save joeyabanks/fe8586f38e01c2d48f6b88a4746cc3dc to your computer and use it in GitHub Desktop.

Select an option

Save joeyabanks/fe8586f38e01c2d48f6b88a4746cc3dc to your computer and use it in GitHub Desktop.

Revisions

  1. joeyabanks revised this gist Sep 1, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion SMSVerify
    Original file line number Diff line number Diff line change
    @@ -10,7 +10,7 @@ struct phoneInput: View {
    Divider()
    Text("+1")
    .foregroundColor(Color(UIColor.secondaryLabel))
    TextField("(123) 456 -7890", text: $input)
    TextField("(123) 456-7890", text: $input)
    .keyboardType(.decimalPad)
    }
    .frame(height: 24)
  2. joeyabanks created this gist Sep 1, 2020.
    53 changes: 53 additions & 0 deletions SMSVerify
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,53 @@
    import SwiftUI
    import PlaygroundSupport

    struct phoneInput: View {
    @State var input = ""
    var body: some View {
    VStack {
    HStack (spacing: 14) {
    Text("🇺🇸")
    Divider()
    Text("+1")
    .foregroundColor(Color(UIColor.secondaryLabel))
    TextField("(123) 456 -7890", text: $input)
    .keyboardType(.decimalPad)
    }
    .frame(height: 24)
    }
    .padding(20)
    .background(Color(UIColor.secondarySystemFill))
    .cornerRadius(14)
    }
    }

    struct Screen: View {
    var body: some View {
    VStack (alignment: .center, spacing: 24) {
    Text("Enter your mobile number")
    .font(.largeTitle)
    .fontWeight(.semibold)
    .multilineTextAlignment(.center)
    Text("We'll text you a verification code. Message and data rates may apply.")
    .multilineTextAlignment(.center)
    .foregroundColor(Color(UIColor.secondaryLabel))

    phoneInput()

    Button(action: {}) {
    Text("Continue")
    .fontWeight(.semibold)
    }
    .padding()
    .foregroundColor(.white)
    .frame(maxWidth: .infinity)
    .background(Color.orange)
    .cornerRadius(14)
    }
    .padding(24)
    .frame(width: 375, height: 812)
    .background(Color.black)
    }
    }

    PlaygroundPage.current.setLiveView(Screen())