For some programming reason, I need to know the real size (width and height) of an UIView wich has constraints.
Depending on the device I use, and depending on the orientation of the device, the width or height of my view change, but frame and layer frame don't give me the correct result.
Is there a mean to have the size?
Likely, the call to the computeSize func happens before all objects frame properties are updated (before redraw has ended).
If you perform this computation in another thread, that should work:
override func viewDidLayoutSubviews() {
super.viewDidLayoutSubviews()
DispatchQueue.main.async {
self.computeSize()
}
}