In my ContentView
I have a simple custom view:
var body: some View {
VStack {
Text("Hi")
Circles().frame(width: 200, height: 200)
Text("Bye")
}
}
where Circles
is a UIViewRepresentable
:
func makeUIView(context: Context) -> CircleView {
return CircleView()
}
CircleView
is A UIView
but I'm unable to find get frame or bounds where the height and width are non-zero. The view displays at the correct size, but I can't where in the UIView life cycle that layout has completed. (At init
time the height/width are still 0)
At least in UIView.layoutSubviews
the bounds is already valid (I used override it for the needs of layouting sublayers).
open func layoutSubviews()
You can override other UIView
methods to find out where it becomes defined for your needs.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With