Different storyboards for different devices in Xcode 6

15,433

Solution 1

At Xcode 5 even using universal apps, i have two storyboards, one for iPad and another for iPhone. But now, in Xcode 6, theres just one storyboard for universal apps. I want to have two storyboards again, but I didn't find how to do this.

Do it the same way you were doing it in Xcode 5. No law says you have to have just one storyboard in a universal app in Xcode 6. The old way works just fine. I have apps that still do this (recompiled in Xcode 6 for iOS 8); it works.

However, something odd is undoubtedly going on. Look at this screen shot. It shows two projects open simultaneously in Xcode 6. One shows the iPhone / iPad buttons for switching between settings within the Universal setting; the other doesn't. I can't find a difference between the two projects that causes this differing interface.

enter image description here

Solution 2

  1. Open your Project setting >> select info
  2. In Custom iOS Target Properties add New row name Main storyboard file base name (iPad) and set value to "your new storyboard file name"

or You can find the way in my blog

Xcode 6 Separate storyboard for iPad and iPhone

Share:
15,433

Related videos on Youtube

Alexandre Nunes Costa
Author by

Alexandre Nunes Costa

Updated on June 22, 2022

Comments

  • Alexandre Nunes Costa
    Alexandre Nunes Costa almost 2 years

    In the new Xcode 6, we have just one storyboard for universal apps. But the differences in my app are beyond the different sizes of the screen between iPhone and iPad. My App iPhone screen does not rotate, it's just portrait, and my iPad screen rotate all. My iPhone first screen is a table view, and my iPad first screen is a collection view, and other differences. How can I make it happen in Xcode 6?

    In other words. At Xcode 5 even using universal apps, i have two storyboards, one for iPad and another for iPhone. But now, in Xcode 6, theres just one storyboard for universal apps. I want to have two storyboards again, but I didn't find how to do this.

  • Alexandre Nunes Costa
    Alexandre Nunes Costa over 9 years
    I don't have level to put images at my question, but in Xcode 6 theres no fields to configure two storyborads like in Xcode 5. I've uploaded the prints in my Google Drive. drive.google.com/…
  • matt
    matt over 9 years
    I didn't say anything about fields. Those fields are just front ends for editing the Info.plist. Learn to edit the Info.plist directly.
  • matt
    matt over 9 years
    Besides you can do it. Switch to iPhone and set the name of the storyboard for iPhone. Switch to iPad and set the name of the storyboard for iPad. Now switch to Universal. Do nothing. Done. Basically they've made the interface easier.
  • matt
    matt over 9 years
    Or, make it totally automatic by using automatic names, e.g. Main.storyboard and Main~ipad.storyboard.
  • matt
    matt over 9 years
    Okay so now I've given you three different ways to set it up.
  • Alexandre Nunes Costa
    Alexandre Nunes Costa over 9 years
    It's bizarre, but worked. I created a github project with step by step commits. thanks matt. github.com/alexandrenc/TwoStoryboards
  • matt
    matt over 9 years
    Nevertheless I do see why you're confused. I'm confused too. See my addition to my answer.
  • matt
    matt over 9 years
    I've filed a bug report on this. I can understand if they have abolished the iPhone / iPad buttons, but I do not see why those buttons sometimes appear and sometimes don't.
  • Thomás Pereira
    Thomás Pereira over 9 years
    TOP solution! Thanks.
  • Natasha
    Natasha about 9 years
    Thanks, very helpful.