I still don't understand how I should get the updated frame of a UIView
, when using autolayout.
Let's say I:
- Setup some views using autolayout.
- Make an HTTP request to get some data.
- When I get the data, I want to draw it but I need the updated frame size of a view.
How should I go about it?
My guess, but it's wrong:
layoutMyViews()
makeHttpRequest(callback)
func callback(data: MyData) {
drawData(data, into:dataView)
}
func drawData(data: MyData, into view:UIView) {
let size = view.frame.size
// Here I want to draw data into view, depending on size, but it may be (0,0)
}