A year ago I've seen couple of Apple WWDC keynotes about benefits of Auto Layout, but when I tried them in real world projects, I experienced that when you move some UI element on a Storyboard even slightly, it breaks half of the constraints, nullifying all the benefits of Auto Layout.
Till now I've been utilising Springs & Struts quite successfully, and in conjunction with KVO observing frame path for view, handled most of rotation realignments gracefully, with just couple lines of code.
So now with iOS 7 coming out, I got a question: Can I keep successfully utilising Springs & Struts only for iOS 7 apps and avoid using Auto Layout? Or am I losing out on anything by doing so? Learning and mastering skill of using Auto Layout in different scenarios would probably take couple of days to me, so I'd really appreciate some argumented advice.
RESOLVED: Thanks to Max's answer, I started to dig into Auto Layout; while Null
is right in his answer - you actually can use Springs & Struts on iOS 7 without too much trouble, Auto-Layout is powerful.
Apparently in Xcode 5, the following things are fixed:
To delete a constraint you don't actually need to perform ancient shamanic dance of rain. You delete it and layout goes into warning mode, indicating issues you need to resolve to make Auto Layout work.
When you move things around, your constraints does not change; only view frame in Interface Builder changes.
When frame in Interface Builder is actually different from calculated with layout constraints frame, Interface Builder will indicate the runtime frame of that element with red dotted line. Finally it is done right. Thanks, Apple.
Here's a link to WWDC 2013 session that demonstrates how to utilise all of that in Xcode 5. You'd need apple developer account to view that.
So my choice now is Auto Layout. Thank you everybody.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…