Skip to content

Instantly share code, notes, and snippets.

@jordansinger
Created July 1, 2020 14:29
Show Gist options
  • Select an option

  • Save jordansinger/2d2299393cbd6b0c5b0d04867b996717 to your computer and use it in GitHub Desktop.

Select an option

Save jordansinger/2d2299393cbd6b0c5b0d04867b996717 to your computer and use it in GitHub Desktop.
Run this in Swift Playgrounds on iPad or Mac
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