3 ms·
I recently learned and used Autolayout to design a few different apps. It has its pros and cons. For relatively simple UIs, it's great, especially if you use In
by archagon 12y ago
I recently learned and used Autolayout to design a few different apps. It has its pros and cons. For relatively simple UIs, it's great, especially if you use Interface Builder. It really lets you express what you mean when you lay something out, and it automatically works with all screen sizes. On the other hand, if you're doing anything that requires lots of little views laid out in an orderly way — a keyboard, for instance — it's more trouble than it's worth.
I think for Autolayout to have more general appeal, it needs two things. One, an easier way to use it programmatically. (Creating NSLayoutConstraints all the time is annoying.) And two, a better way to define equal spacing between views. (Creating spacer views is incredibly boilerplate-y.)
Also, the more constraints you have, the harder it gets to conceptualize things like intrinsic contents sizes, priorities, and inequalities.
- emkman 12y agoHave you tried Masonry? It might be right for you if you want easier programatic use than NSLayoutConstraints provide. https://github.com/Masonry/Masonry https://github.com/Masonry/Masonry