Skip to content

Instantly share code, notes, and snippets.

@jordansinger
Created May 12, 2020 23:57
Show Gist options
  • Save jordansinger/2a0f8e0d2b38869560bbf98179568f9d to your computer and use it in GitHub Desktop.
Save jordansinger/2a0f8e0d2b38869560bbf98179568f9d to your computer and use it in GitHub Desktop.
import SwiftUI
import PlaygroundSupport
struct Screen: View {
var body: some View {
VStack {
ForEach(1...4, id: \.self) { _ in
HStack {
Spacer()
VStack {
Rectangle().frame(width: 60, height: 60).foregroundColor(Color(UIColor.systemRed)).cornerRadius(16)
Text("App").font(.footnote).padding(.top, 2)
}
Spacer()
VStack {
Rectangle().frame(width: 60, height: 60).foregroundColor(Color(UIColor.systemOrange)).cornerRadius(16)
Text("App").font(.footnote).padding(.top, 2)
}
Spacer()
VStack {
Rectangle().frame(width: 60, height: 60).foregroundColor(Color(UIColor.systemYellow)).cornerRadius(16)
Text("App").font(.footnote).padding(.top, 2)
}
Spacer()
VStack {
Rectangle().frame(width: 60, height: 60).foregroundColor(Color(UIColor.systemGreen)).cornerRadius(16)
Text("App").font(.footnote).padding(.top, 2)
}
Spacer()
}
}.padding(.top)
Spacer()
HStack {
Rectangle().frame(width: 60, height: 60).foregroundColor(Color(UIColor.systemBlue)).cornerRadius(16)
Spacer()
Rectangle().frame(width: 60, height: 60).foregroundColor(Color(UIColor.systemIndigo)).cornerRadius(16)
Spacer()
Rectangle().frame(width: 60, height: 60).foregroundColor(Color(UIColor.systemPurple)).cornerRadius(16)
Spacer()
Rectangle().frame(width: 60, height: 60).foregroundColor(Color(UIColor.systemPink)).cornerRadius(16)
}.padding().background(Color(UIColor.secondarySystemBackground)).cornerRadius(20).padding()
}
}
}
PlaygroundPage.current.setLiveView(Screen())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment