Ad

Is The Layout Of The Code Via CGRect Correct?

- 1 answer

Is it right to make the interface via CGRect? I hardly use constraints. For the most part, my interface consists of labels spread across the entire width of the screen.

Ad

Answer

When you want to use CGRect you should be aware of autoresizingMask,
Both auto layout(constraints) and auto Autoresizing mask used for layout iOS and macOS Apps, both of them has cons and pros.
I suggest you to read apple document about autoresizing mask:
https://developer.apple.com/documentation/uikit/uiview/1622559-autoresizingmask

and then read this article about cons and pros of both of these and also usage to know when it's better to use auto layout or autoresizingMask:
https://www.advancedswift.com/autolayout-vs-autoresizing-masks/

Ad
source: stackoverflow.com
Ad