Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Learning iOS UI Development

You're reading from  Learning iOS UI Development

Product type Book
Published in Dec 2015
Publisher
ISBN-13 9781785288197
Pages 196 pages
Edition 1st Edition
Languages

Size classes and Interface Builder


Storyboard and XIB files can be used in conjunction with size classes. You can think of this as the ability to specify different layouts in the same file without adding a single line of code.

This is obviously a huge improvement to our workflow; among other things, we can now define universal applications using the same Storyboard for iPad and iPhone without duplicating all the IBOutlet and IBAction connections and subsequently update just a single file instead of keeping two different Storyboards synchronized.

Hands-on code

Let's explore this with a simple example of how easy it is to handle size classes with Interface Builder.

The main goal of the next example is creating a layout that's suitable for iPhone and another one that looks great on iPad, using the same Storyboard for both. We will create a simple hierarchy based on two views that we will call "Menu view" and "Detail view". It is something similar to what we can obtain using UISplitViewController...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime}