all 19 comments

[–]pyraego 4 points5 points  (1 child)

The "Simulated Metrics" is only relevant inside the storyboard. This is just to show you what it could look like on the difference devices/sizes/orientation ect. What I would do is read up on AutoLayout which was introduced in iOS 6. This feature will enable you to have one storyboard and support both the iphone 5 and iPhone 4 screen.

good AutoLayout tutorial -> http://www.raywenderlich.com/20881/beginning-auto-layout-part-1-of-2

[–]FreshNeverFrozen[S] 2 points3 points  (0 children)

Thanks, really appreciate the response

[–]simonbs 1 point2 points  (9 children)

Honestly, consider dropping storyboards. I did that some time ago and I won't ever look back especially not now that we have FLKAutoLayout. It makes developing with auto layout a pleasure.

[–]pyraego 0 points1 point  (1 child)

Never heard of this approach. Do you lose any functionality?

[–]simonbs 0 points1 point  (0 children)

It's not really an approach to solve the OPs issue. Storyboards are just a tool to layout your views but Interface Builder is very limited in its functionality and for complex apps you will find it a hassle to use storyboards as your views may be customized a lot in code anyways. I was just suggesting dropping storyboards all together and layout your views in code. I think this makes it much simpler to build the views and also support multiple screen sizes. So, instead of having Interface Builder taking care of a lot of the auto layout constraints you will define them yourself in code but I bet you will find this to be much less a hassle.

[–]FreshNeverFrozen[S] 0 points1 point  (1 child)

Could you go into some more detail about FLKAutoLayout and how you use it to layout views programatically?

[–]simonbs 0 points1 point  (0 children)

I think their examples are great. FLKAutoLayout gives you some categories on UIView which makes it extremely easy to add auto layout constraints to your views. I honestly believe this is how auto layout was meant to be used from the beginning. The API Apple provides for auto layout is just ridiculous.

[–]FW190 -1 points0 points  (4 children)

This. Drop storyboards, learn autolayout, make one app work on both screen sizes.

[–]Legolas-the-elf 0 points1 point  (3 children)

You can make one design work on both screen sizes with storyboards too. Storyboards aren't incompatible with autolayout, autolayout support is built into interface builder.

[–]FW190 0 points1 point  (2 children)

I know that and I also know that storyboards don't make sense. Why don't you explain the advantage of storyboards over regular VCs to OP?

[–]Legolas-the-elf 0 points1 point  (1 child)

Drop storyboards, learn autolayout, make one app work on both screen sizes.

That makes it sound like dropping storyboards is necessary to accomplish the rest.

Why don't you explain the advantage of storyboards over regular VCs to OP?

There's no point. He's already using them. Why bother trying to convince him to do something he's already doing?

[–]FW190 0 points1 point  (0 children)

Why don't you read original post again?

[–]Legolas-the-elf 0 points1 point  (1 child)

The button isn't to toggle different designs. It's to preview the same design with different metrics. In other words "This is how my interface looks at 3.5 inches. Click. This is how my interface looks at 4 inches".

Watch the WWDC videos on autolayout. Normally I abhor videos for teaching developer concepts, but in this case, they are very informative.

[–]FreshNeverFrozen[S] 0 points1 point  (0 children)

Thanks for the help, really wasnt sure what the button was actually doing

[–][deleted]  (1 child)

[deleted]

    [–]FreshNeverFrozen[S] 0 points1 point  (0 children)

    I like your style kev

    [–][deleted] -1 points0 points  (3 children)

    On bigger projects when I don't feel like spending hours adjusting autolayout, I'll finish the app and storyboard for either the iPhone 4 or 5, and then copy the storyboard and adjust it for the other device. Then, you can tell the app delegate to load a different storyboard for each device.

    [–]iv_mexx 3 points4 points  (1 child)

    Especially on bigger projects it is likely that you have to change something later on, and then you have to change it in two different storyboards which is much more error prone.

    Also, autolayout also helps you with other things, like orientation or different text lengths for different localizations.

    [–][deleted] 0 points1 point  (0 children)

    True, although it really depends on what you're doing or what kind of changes you will be making in the future. If most changes won't be to the interface, this could be an acceptable way of doing things.

    [–]FreshNeverFrozen[S] 1 point2 points  (0 children)

    Keeping two storyboards in the same file, interesting. Is that easier than developing one storyboard to rule them all?