Skip to content

Instantly share code, notes, and snippets.

@joeyabanks
Last active September 1, 2020 03:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joeyabanks/fe8586f38e01c2d48f6b88a4746cc3dc to your computer and use it in GitHub Desktop.
Save joeyabanks/fe8586f38e01c2d48f6b88a4746cc3dc to your computer and use it in GitHub Desktop.
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