Last active
September 1, 2020 03:29
-
-
Save joeyabanks/fe8586f38e01c2d48f6b88a4746cc3dc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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