Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do we need to use 2 Storyboard for a Universal app?

I have a project for iPhone and iPad. The iPad needs a split view controller. Do we create two separate storyboards? One for iPhone (using autolayout we can support all devices) and two for iPad. My doubt is the difference it only in initial view. The inside views repeats. How will be your approach with storyboard ?

like image 439
J J Avatar asked Oct 14 '14 18:10

J J


2 Answers

No need for two storyboards any more in iOS 8! We can use Adaptive UI in order to tailor the same storyboard all different sizes of iPad and iPhone.

You can find a nice tutorial in here http://www.raywenderlich.com/83276/beginning-adaptive-layout-tutorial

And also you can find a nice video by apple in WWDC conference here and search for "Building Adaptive Apps with UIKit"

Basically we can handle different screen sizes by defining elements of our UI in storyboard for different size classes. We can also define different Auto layout constraints for different size classes.

And these are all possible size classes in iOS 8 ( I took the image from https://medium.com/@getaaron/ios-8-development-tips-for-iphone-6-and-iwatch-1c772554ffe0)

enter image description here

like image 110
Amir Rezvani Avatar answered Sep 19 '22 10:09

Amir Rezvani


For iOS 7 and before, yes, use two storyboards and two completely different interfaces, since there is no split view controller on the iPhone.

For iOS 8, use one storyboard, and use the UISplitViewController on both the iPad and the iPhone. Make a new project from the Universal version of the Xcode 6 Master-Detail app template to see all about how it works! It is automatically a split view controller on the iPad and a navigation interface on the iPhone.

like image 31
matt Avatar answered Sep 19 '22 10:09

matt