Skip to content

Instantly share code, notes, and snippets.

@jordansinger
Created May 11, 2020 23:24
Show Gist options
  • Star 11 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jordansinger/031832f9b57da84f12af77051529219e to your computer and use it in GitHub Desktop.
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
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