Created
May 11, 2020 23:24
-
-
Save jordansinger/031832f9b57da84f12af77051529219e to your computer and use it in GitHub Desktop.
Let’s recreate the iPhone lock screen using SwiftUI and Swift Playgrounds on iPad
This file contains 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 { | |
VStack { | |
Text("5:45").font(.system(size: 64, weight: .thin)) | |
Text("Monday, May 11").font(.system(size: 24)) | |
}.padding(.vertical, 32) | |
VStack { | |
VStack(alignment: .leading) { | |
HStack { | |
Rectangle().frame(width: 16, height: 16).foregroundColor(Color(UIColor.systemFill)).cornerRadius(4) | |
Text("APP NAME").font(.caption) | |
Spacer() | |
Text("21m ago").font(.caption) | |
} | |
Text("Notification title").font(.headline) | |
Text("This is the notification body") | |
}.padding().background(Color(UIColor.secondarySystemBackground)).cornerRadius(12) | |
}.padding() | |
} | |
} | |
} | |
PlaygroundPage.current.setLiveView(Screen()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment