Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Nov 22, 2012, 11:00 AM   #1
ArtOfWarfare
macrumors 601
 
ArtOfWarfare's Avatar
 
Join Date: Nov 2007
Send a message via Skype™ to ArtOfWarfare
Getting back Struts and Springs

Hi guys, I thought I'd share this for anyone else who despises the new Constraints Auto-Layout system:

To turn it off, go into your interface file, choose the document tab (the leftmost one in the tab bar on the right panel.) and uncheck the box "Use Auto Layout"

And bam, just like that, it tosses out the hundreds of complicated constraints (which do anything but "just work" like Apple's docs say they do,) and takes you back to the actually auto-magical system of struts and springs.

I can't say how many times I've been working on an Android app in Eclipse and just wished they had a layout system anywhere near as simple as struts and springs. I was dumbfounded when I saw Apple had actually duplicated the freaking nightmare that is Android UI design (okay, maybe not quite duplicated... they don't force you to pick from a dozen layouts like Android.)

Oh, and as a further nail in the coffin for Constraints and Auto-Layout, it means that Snow Leopard users can't use your app. (As much as I like Lion/ML, I still hear that tons of my customers use SL, so I consider it essential that I continue to support it.)
__________________
Battery Status - On the Mac App Store
The only app that'll estimate when your wireless devices will need their batteries changed.
Including the ones paired with other Macs on your network.
ArtOfWarfare is offline   0 Reply With Quote
Old Nov 22, 2012, 12:30 PM   #2
Senor Cuete
macrumors member
 
Join Date: Nov 2011
Good Tip

I couldn't get an auxiliary panel to look right in an NSSavePanel. A popoup menu was clipped. It turned out that Auto Layout was the problem and it took me a long time to figure it out.
Senor Cuete is offline   0 Reply With Quote
Old Nov 22, 2012, 12:33 PM   #3
nuckinfutz
macrumors 603
 
nuckinfutz's Avatar
 
Join Date: Jul 2002
Location: Middle Earth
http://blog.ideveloper.tv/podcast-73/

Erica Sadun brings up a great point about how the experiences of constraints varies drastically depending on how much you use Interface Builder or not.
nuckinfutz is offline   0 Reply With Quote
Old Nov 22, 2012, 01:31 PM   #4
gnasher729
macrumors G5
 
gnasher729's Avatar
 
Join Date: Nov 2005
Quote:
Originally Posted by ArtOfWarfare View Post
Hi guys, I thought I'd share this for anyone else who despises the new Constraints Auto-Layout system:

To turn it off, go into your interface file, choose the document tab (the leftmost one in the tab bar on the right panel.) and uncheck the box "Use Auto Layout"

And bam, just like that, it tosses out the hundreds of complicated constraints (which do anything but "just work" like Apple's docs say they do,) and takes you back to the actually auto-magical system of struts and springs.
Ahem... struts and springs work "auto-magically" up to some degree, and then it breaks down. There are plenty of things that you just can't do. And good luck if you have views where the width or height can be changed to zero.
gnasher729 is offline   0 Reply With Quote
Old Nov 23, 2012, 12:40 PM   #5
Mark FX
macrumors member
 
Join Date: Nov 2011
Thanks ArtOfWarfare.

I was wondering if there was a way of getting the struts and sprigs back.

Regards Mark
Mark FX is offline   0 Reply With Quote
Old Jul 13, 2013, 12:14 PM   #6
ArtOfWarfare
Thread Starter
macrumors 601
 
ArtOfWarfare's Avatar
 
Join Date: Nov 2007
Send a message via Skype™ to ArtOfWarfare
I'm going to now mock myself of yesteryear by beginning this post the same way I started the original one:

Hi guys, I thought I'd share this for anyone who despises the Constraints Auto-Layout system:

First off, a comic explaining how you feel:



Next, a tutorial that should help you understand why the new system is helpful and how to use it:

http://www.raywenderlich.com/20881/b...ut-part-1-of-2

But now, I think I'd like to mention one thing that Struts and Springs easily has on Constraints which might lead to Constraints becoming less despised by people transitioning:

Struts and Springs clearly showed which ones were turned on (as Constraints do) AND also showed what potential additions could be made. Making those additions were as easy as clicking on them. I think Constraints should be always visible directly in the interface to be easily turned on.

And I suppose I'll share an anecdote of this sudden turnabout from a Constraint hater to lover:

I was Googling about an hour ago "What is the longest international weekday title?" I have a label that needs to hold a weekday name but no more. I know that Wednesday will take up the most space in English, but who knows what crazy weekday names German, for example, has (as it turns out, it looks like Icelandic might actually have the longest names for weekdays... or possibly Indian...)

Then I realized the absurdity of what I was looking for, thought, "there has to be a better way", and then I realized the better way had to be within abandoning struts and springs and going to constraints. The tutorial I posted actually mentions that constraints solve exactly this kind of problem.
__________________
Battery Status - On the Mac App Store
The only app that'll estimate when your wireless devices will need their batteries changed.
Including the ones paired with other Macs on your network.

Last edited by ArtOfWarfare; Jul 13, 2013 at 12:23 PM.
ArtOfWarfare is offline   0 Reply With Quote
Old Nov 16, 2013, 03:05 PM   #7
ArtOfWarfare
Thread Starter
macrumors 601
 
ArtOfWarfare's Avatar
 
Join Date: Nov 2007
Send a message via Skype™ to ArtOfWarfare
Even better reference than my prior one:

WWDC 2012 session 232: Autolayout by Example

If you don't love auto layout by the end of it, you've never managed a project with localization and you've never made a UI with more than 2 views in it.
__________________
Battery Status - On the Mac App Store
The only app that'll estimate when your wireless devices will need their batteries changed.
Including the ones paired with other Macs on your network.

Last edited by ArtOfWarfare; Nov 16, 2013 at 03:20 PM.
ArtOfWarfare is offline   0 Reply With Quote
Old Nov 19, 2013, 07:30 PM   #8
Qaanol
macrumors 6502
 
Join Date: Jun 2010
Thanks AoW, good job finding this setting.

I have an Xcode project set to build for a 10.6 target, but for some reason it decided to use Autolayout, which of course doesn’t work on 10.6.
Qaanol is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 06:59 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC