Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Objective C - One storyboard for iPad and iPhone

I just want to know if it is possible for an iPad and iPhone application to share the same storyboard?

I currently have 2 storyboards, one for iPad and one for iPhone. Is it possible to have both devices running form the same storyboard?

Regards, EZFrag

like image 598
EZFrag Avatar asked Jun 22 '12 11:06

EZFrag


2 Answers

If your iPhone and iPad has same views, then this is possible, the views you create in your iPhone will stretch to fill the iPad screen, however this is not recommended since iPad has bigger screen you should create different views with different view arrangements and structure for both the iPad and the iPhone

To set the same story board for the iPad and iPhone check the screen shot

enter image description here

like image 88
Omar Abdelhafith Avatar answered Nov 05 '22 16:11

Omar Abdelhafith


Using the XCode6 Size Classes you can officially have the same Storyboard used for both the iPhone (all resolutions) and the iPad, saving you from keeping two files up to date. The resulting storyboard is compatible with iOS7+.

Read more about this here: https://developer.apple.com/library/ios/recipes/xcode_help-IB_adaptive_sizes/chapters/AboutAdaptiveSizeDesign.html#//apple_ref/doc/uid/TP40014436-CH6-SW1 Use size classes to enable a storyboard or xib file to work with all available screen sizes. This enables the user interface of your app to work on any iOS device.

like image 40
Ciprian Rarau Avatar answered Nov 05 '22 15:11

Ciprian Rarau