geometry reader in swiftui code example
Example: swiftui geometryreader
struct ContentView: View {
var body: some View {
GeometryReader { geometry in
HStack(spacing: 0) {
Text("Left")
.frame(width: geometry.size.width * 0.33, height: 50)
.background(Color.yellow)
Text("Right")
.frame(width: geometry.size.width * 0.67, height: 50)
.background(Color.orange)
}
}
}
}