When you write your views in code and use autolayout, you need to turn off the autoresizing resizing masks, like this:
myView.translatesAutoresizingMaskIntoConstraints = false. And you’ll be doing this for every view you add to your view hierarchy.
To make this easier to type, I made an extension on
UIView to turn off the autoresizing masks,
And I named the function
autolayout because in a sense, you’re turning on autolayout with this call.
Here’s an example usage from version 1.1 of Underway:
You may say, that doesn’t save that much, and autocomplete makes it easy enough to type! That’s also a valid view.
Hope you liked this.