Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
I don't have a ton of experience building native iOS apps but from the limited amount I've done auto-layout was always a little hard to wrap my head around. It seems pretty powerful though!
-
rizza49yIt is power full. I'm not display agreeing that. But no good explanations for universal apps
-
I've been using autolayout for a while now and they're pretty cool. A few quick tips if I may:
1- it's always easier to set them up in Interface Builder than programmatically, because you can see how things will look like right away
2- a constraint with any priority below 1000 can be changed programmatically
3- change priorities instead of adding/activating/removing/deactivating constraints
4- classes can have IBOutlets to constraints -
5- changes to constraints are animatable by wrapping a view.layoutIfNeeded() call in an animation closure
6- Regular constraints will affect iPads and iPhones 6 Pluses only and if present, otherwise fallback to Any Height or Width
7- iPads do not respond to Compact constraints unless the device is in multi-app mode
8- All other size classes are pertinent to iPhones only
9- when 2 constraints compete for the same layout parameter (width, height, x and y), the highest priority one will prevail
For iOS and OSX devs. Do you really know how auto layout works? It is something I do but don't know how it works
undefined