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