-
-
Save maxhumber/1dbdf0d9c4539a8e145b3c630c6da0b3 to your computer and use it in GitHub Desktop.
SwiftUI in 2022
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 ContentView: View { | |
var body: some View { | |
GeometryReader { geo in | |
ZStack { | |
ZStack(alignment: .topLeading) { | |
Color.red | |
.aspectRatio(1, contentMode: .fit) | |
.padding(10) | |
Color.blue | |
.aspectRatio(1, contentMode: .fit) | |
.padding(10) | |
.frame(width: geo.size.width * 0.1) | |
} | |
Color.blue | |
.aspectRatio(1, contentMode: .fit) | |
.frame(width: geo.size.width * 0.5) | |
} | |
} | |
.frame(width: 300, height: 500) | |
} | |
} | |
PlaygroundPage.current.setLiveView(ContentView()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment