I'm developing an app with Storyboard on iOS 6.1 (with many features - star ranking, sqlite DB, apple maps, etc..). Sometimes It happens that I have to disable the auto layout (for UIScrollView
for example) or use code to work around the problem, but there are other examples. However when I disable it, I have to configure the UILabels
with the exact width or other things.
What is the best option? Use auto layout or don't use it on iOS 6.x with Storyboard?
Autolayout, like many other features added to ios in recent years (arc and storyboards, for instance) was designed to ease development for both people who're just getting started in the iOS/Mac platform or for people who are already there but don't come from the old days of NeXT or OS X's infancy and thus could use some simplification to the whole development workflow.
One thing you could do is use autolayout by default, therefore making easier to write ViewControllers that perform both in portrait and in landscape, and disable it on those rare ocassions where you're more comfortable keeping everything using the old system of springs and struts. Another thing you can do is to also add Autolayout constraints in code instead of through Xcode's Interface Builder, if that suits your style better.
My advice is to use whatever system makes you more comfortable, no matter what the current trend is.
I don't use autolayout, because it's raw now. If you order constraints and then decide to move an element, you can get a real mess.
It's much safer to use springs and struts at this moment.
Upd.: But it's OK to use it in iOS7 - there are a lot of helpful tools for it in Xcode 5.
Honestly, this is up to preference but I never use auto layout and I doubt that I ever will. I guess I just prefer everything being exactly how I specify it and I don't trust auto layout.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With