-
-
Save sturdysturge/33ec752a7f2e40c4e13aa1a0df8c4892 to your computer and use it in GitHub Desktop.
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 | |
| struct ContentView: View { | |
| @State var rectanglePriority: CGFloat = 0 | |
| @State var circlePriority: CGFloat = 0 | |
| var body: some View { | |
| ZStack { | |
| HStack { | |
| Rectangle() | |
| .layoutPriority(rectanglePriority) | |
| Circle() | |
| .layoutPriority(circlePriority) | |
| } | |
| VStack { | |
| Stepper("Rectangle \(rectanglePriority)", value: $rectanglePriority) | |
| Stepper("Circle \(circlePriority)", value: $circlePriority) | |
| } | |
| .padding() | |
| .foregroundColor(.black) | |
| .background(Material.thin) | |
| .frame(maxHeight: .infinity, alignment: .bottom) | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment