Skip to content

Instantly share code, notes, and snippets.

@makoscafee
Created August 6, 2020 14:05
Show Gist options
  • Save makoscafee/624e87790689a9c486a1a90474c42a7d to your computer and use it in GitHub Desktop.
Save makoscafee/624e87790689a9c486a1a90474c42a7d to your computer and use it in GitHub Desktop.
import SwiftUI
let lightGreen = UIColor(red: 11/255, green: 224/255, blue: 93/255, alpha: 1)
let darkGreen = UIColor(red: 0/255, green: 213/255, blue: 75/255, alpha: 1)
struct ContentView: View {
var body: some View {
ZStack {
Color(darkGreen)
VStack {
HStack {
Image(systemName: "camera.viewfinder")
.foregroundColor(.white)
.font(.title)
Spacer()
Image(systemName: "circle")
.foregroundColor(.white)
.font(.title)
}
.padding(EdgeInsets(top: 60, leading: 20, bottom: 10, trailing: 20))
Spacer()
VStack {
Text("$0")
.foregroundColor(.white)
.font(.system(size: 100))
.fontWeight(.semibold)
}
.padding()
Spacer()
VStack(alignment: .center) {
HStack {
ForEach(1..<4) { digit in
Spacer()
Button(action: {}) {
Text("\(digit)")
.foregroundColor(.white)
.fontWeight(.bold)
.font(.title3)
}
Spacer()
}
}
.padding()
HStack {
ForEach(4..<7) { digit in
Spacer()
Button(action: {}) {
Text("\(digit)")
.foregroundColor(.white)
.fontWeight(.bold)
.font(.title3)
}
Spacer()
}
}
.padding()
HStack {
ForEach(7..<10) { digit in
Spacer()
Button(action: {}) {
Text("\(digit)")
.foregroundColor(.white)
.fontWeight(.bold)
.font(.title3)
}
Spacer()
}
}
.padding()
HStack {
Spacer()
Button(action: {}) {
Text(".").bold()
.frame(maxWidth: .infinity)
.foregroundColor(.white)
.font(.title3)
}
Spacer()
Button(action: {}) {
Text("0").bold()
.frame(maxWidth: .infinity)
.foregroundColor(.white)
.font(.title3)
}
Spacer()
Button(action: {}) {
Text("<").bold()
.frame(maxWidth: .infinity)
.foregroundColor(.white)
.font(.title3)
}
Spacer()
}
.padding()
}
.padding()
HStack {
Button(action: {}) {
Text("Request")
}
.font(Font.subheadline.bold())
.frame(width: 170, height: 50)
.foregroundColor(.white)
.background(Color(lightGreen))
.cornerRadius(25)
Spacer()
Button(action: {}) {
Text("Pay")
}
.font(Font.subheadline.bold())
.frame(width: 170, height: 50)
.foregroundColor(.white)
.background(Color(lightGreen))
.cornerRadius(25)
}
.padding()
Spacer()
}
}
.edgesIgnoringSafeArea(.all)
}
}
struct AppView: View {
init() {
UITabBar.appearance().barTintColor = UIColor.init(red: 0/255, green: 225/255, blue: 70/255, alpha: 1)
UITabBar.appearance().layer.borderWidth = 0.0
UITabBar.appearance().clipsToBounds = true
UITabBar.appearance().unselectedItemTintColor = UIColor.white
}
var body: some View {
TabView {
ContentView()
.tabItem {
Image(systemName: "house")
Text("")
}
ContentView()
.tabItem {
Image(systemName: "creditcard")
Text("")
}
ContentView()
.tabItem {
Image(systemName: "dollarsign.circle")
Text("")
}
ContentView()
.tabItem {
Image(systemName: "arrow.up.right")
Text("")
}
ContentView()
.tabItem {
Image(systemName: "timer")
Text("")
}
}
.accentColor(.white)
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
AppView()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment