Skip to content

Instantly share code, notes, and snippets.

@joeyabanks

joeyabanks/SMSVerify

Last active Sep 1, 2020
Embed
What would you like to do?
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())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.