Created
July 1, 2020 14:29
-
-
Save jordansinger/2d2299393cbd6b0c5b0d04867b996717 to your computer and use it in GitHub Desktop.
Run this in Swift Playgrounds on iPad or Mac
This file contains hidden or 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 Keypad: View { | |
| var body: some View { | |
| VStack(spacing: 24) { | |
| HStack { | |
| Spacer() | |
| Text("1") | |
| Spacer() | |
| Text("2") | |
| Spacer() | |
| Text("3") | |
| Spacer() | |
| } | |
| HStack { | |
| Spacer() | |
| Text("4") | |
| Spacer() | |
| Text("5") | |
| Spacer() | |
| Text("6") | |
| Spacer() | |
| } | |
| HStack { | |
| Spacer() | |
| Text("7") | |
| Spacer() | |
| Text("8") | |
| Spacer() | |
| Text("9") | |
| Spacer() | |
| } | |
| HStack { | |
| Spacer() | |
| Text("0") | |
| Spacer() | |
| } | |
| } | |
| .font(.title) | |
| .padding() | |
| .frame(width: 375, height: 256) | |
| .background(Color(UIColor.secondarySystemBackground)) | |
| .cornerRadius(20) | |
| } | |
| } | |
| PlaygroundPage.current.setLiveView(Keypad()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment