-
-
Save indyfromoz/d50c190be7805e063f5ea55d7074a855 to your computer and use it in GitHub Desktop.
Let’s recreate the iOS app store home screen in less than 5 minutes using SwiftUI and Swift Playgrounds on iPad
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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