Search code examples
objective-ciphonexcode6universalscreen-rotation

Stop only iPhone screen rotating in Universal Xcode 6 project


With the introduction of Xcode 6, Apple removed the ability to easily have multiple storyboards for iPad and iPhone in Universal apps. Due to this, you cannot differentiate between iPad and iPhone on the rotation panel/settings.

How can i stop the iPhone app from Rotating into landscape, while still allowing the iPad app to do so.

Is it something you can only do in code? If it is, I am still using Objective C, not Swift.


Solution

  • Remove all the other answers' code. Go to your info.plist file and add the following.

    • "Supported Interface Orientations" - Array
      • "Portrait (bottom home button)" - String
      • "Portrait (top home button)" - String
    • "Supported Interface Orientations (iPad)" - Array
      • "Portrait (bottom home button)" - String
      • "Portrait (top home button)" - String
      • "Landscape (left home button)" - String
      • "Landscape (right home button)" - String