Skip to content

Instantly share code, notes, and snippets.

@sturdysturge
Last active November 8, 2022 00:45
Show Gist options
  • Select an option

  • Save sturdysturge/33ec752a7f2e40c4e13aa1a0df8c4892 to your computer and use it in GitHub Desktop.

Select an option

Save sturdysturge/33ec752a7f2e40c4e13aa1a0df8c4892 to your computer and use it in GitHub Desktop.
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