Skip to content

Instantly share code, notes, and snippets.

@indyfromoz
Forked from jordansinger/Keypad.swift
Created July 2, 2020 21:05
Show Gist options
  • Save indyfromoz/605226f936f741bc224b60de9a3adf8b to your computer and use it in GitHub Desktop.
Save indyfromoz/605226f936f741bc224b60de9a3adf8b 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