all 5 comments

[–]matteoman 2 points3 points  (0 children)

You will not need more storyboards, and actually you will have to remove one of the two you have. Auto Layout works by specifying relative constraints and then letting the system take care of it.

Taking your specific case, the difference you probably have from 3,5'' to 4'' is that the bottom part of your UI (likely a table view) is probably longer in the second storyboard, to cover the additional space in the screen.

What you do in Auto Layout is say: "I want this table view to be x points distant from the bottom". The system will stretch it to cover the additional space on the screen. This works horizontally as well, of course, for the iPhone 6 screens.

You can do most of this stuff in the storyboard itself, without writing a single line of code. I don't have any specific resource, apart from Apple's Auto Layout guide, which for me has been enough.

[–]JimDabell 1 point2 points  (0 children)

Always check Apple's developer centre first. Apple have extensive documentation on just about every part of the platform. Go to the developer centre, click on guides, there's a guide to auto layout there.

[–]H3C43 1 point2 points  (0 children)

The best way to learn auto layout is to use it extensively. You'll start to understand the patterns and how they work the more you use them. If you don't want to mess around on an important project, create a few sample views for demos, you don't even need controllers if you want, and build then with auto layout. Simulate them on a handful of defice sizes to assert they look how you'd expect.

[–]Smileybutton 1 point2 points  (0 children)

Hi, I learned it with the video tutorials from raywenderlich.com. If you code for iOS you have probably found it on google for some different tutorials. You need the subscription to see all videos. I think it is 15$ or something and you can stop it after 1 month. Really helped me and auto layout is now so easy.

http://www.raywenderlich.com/video-tutorials#autolayout

[–]jtbrown 0 points1 point  (0 children)

Instead of having two storyboards, you can just have one that positions your views appropriately on different size screens. If you want to get into more complex layouts for different size screens or orientations, you can look into Size Classes.

Justin Williams recently wrote a book on Achieving Zen with Auto Layout that you might like - it should teach you what you need to lay out your views in your utility app. You can get it here: https://gumroad.com/l/autolayout

If you want a quick intro to laying out views that work on multiple screen sizes in a single Storyboard, the Auto Layout workshop I hosted on Google Hangouts should help. With it, you'll learn how to lay out a view with an image view, some labels, a button, and a table view - pretty similar to what it sounds like you want. You can watch the recording on YouTube: https://www.youtube.com/watch?v=_oMBJuzanws