I have UIView
that has auto layout constraints. I create it with frame CGRectZero
. So I don't the real size. It will depend on superview.
But I want to know when my view get a frame that I can use for my calculation.
So you shouldn't really need to know anything about the frame. Although if you did need to know, you could just implement -layoutSubviews
in your view, or -viewDidLayoutSubviews
at the view controller level.
Here after calling super
the frames should be set to what AutoLayout resolved them to be.
Also good practise to take on board is #7 of the following post: Forget frame.
I also highly recommend reading about the AutoLayout process here.
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