Skip to content

Instantly share code, notes, and snippets.

@wb-softwares
Created June 18, 2020 21:36
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wb-softwares/a89aad3f76c2cec48f43b25cb4be30cc to your computer and use it in GitHub Desktop.
Save wb-softwares/a89aad3f76c2cec48f43b25cb4be30cc to your computer and use it in GitHub Desktop.
Recreating the iOS App Store home screen using SwiftUI and Swift Playgrounds on iPad
import SwiftUI
import PlaygroundSupport
struct Screen: View {
var body: some View {
ScrollView {
HStack {
VStack (alignment: .leading) {
Text("TUESDAY, MAY 12").foregroundColor(.secondary).bold().font(.footnote)
Text("Today").font(.largeTitle).bold()
}
Spacer()
Image(uiImage: #imageLiteral(resourceName: "0E764E06-6B02-456A-88D3-983CA788E7F7.jpg")).resizable().aspectRatio(contentMode: .fill).frame(width: 40, height: 40, alignment: .trailing).cornerRadius(200)
}.padding([.horizontal, .top])
VStack {
ZStack {
Image(uiImage: #imageLiteral(resourceName: "0E764E06-6B02-456A-88D3-983CA788E7F7.jpg")).resizable().frame(height: 450)
VStack (alignment: .leading) {
Text("LIFE AT HOME").foregroundColor(Color.white.opacity(0.5)).bold().font(.footnote)
Text("3 Quick and Easy Recipes").foregroundColor(.white).bold()
Spacer()
Text("These freezer-friendly options take the stress out of meal prep.").foregroundColor(.white).lineLimit(2)
}.padding()
}
}.cornerRadius(10).padding([.horizontal, .bottom]).shadow(color: Color.black.opacity(0.2), radius: 20, x: 0, y: 20)
VStack {
ZStack {
Image(uiImage: #imageLiteral(resourceName: "0E764E06-6B02-456A-88D3-983CA788E7F7.jpg")).resizable().frame(height: 450)
VStack (alignment: .leading) {
Text("LIFE AT HOME").foregroundColor(Color.white.opacity(0.5)).bold().font(.footnote)
Text("3 Quick and Easy Recipes").foregroundColor(.white).bold()
Spacer()
Text("These freezer-friendly options take the stress out of meal prep.").foregroundColor(.white).lineLimit(2)
}.padding()
}
}.cornerRadius(10).padding([.horizontal, .bottom]).shadow(color: Color.black.opacity(0.2), radius: 20, x: 0, y: 20)
}
}
}
PlaygroundPage.current.setLiveView(Screen())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment