50
votes

I'm working on an universal app with all orientations on iPad and only portrait on iPhone. The app works well with split-screen multitasking on iOS 9 compatible iPad, but I have this warning:

All interface orientations must be supported unless the app requires full screen

And my app does not require full screen. It's only limited to portrait on iPhone... Shouldn't it be ok? Is there a way to declare Requires Full Screen only on iPhone?

Thanks in advance

By the way I'm using Xcode 7.3.1

5
Unfortunately I need the app to support split-screen on iPad but only portrait on iPhone...Zaphod

5 Answers

45
votes

The solution to this is to use "Device Specific Keys": https://developer.apple.com/library/content/documentation/General/Reference/InfoPlistKeyReference/Articles/AboutInformationPropertyListFiles.html#//apple_ref/doc/uid/TP40009254-SW9

Your plist values would therefore look something like:

<key>UISupportedInterfaceOrientations</key>
<array>
    <string>UIInterfaceOrientationPortrait</string>
    <string>UIInterfaceOrientationPortraitUpsideDown</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
    <string>UIInterfaceOrientationPortrait</string>
    <string>UIInterfaceOrientationPortraitUpsideDown</string>
    <string>UIInterfaceOrientationLandscapeLeft</string>
    <string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIRequiresFullScreen</key>
<true/>
<key>UIRequiresFullScreen~ipad</key>
<false/>

When I remove the iPad specific version of the UIRequiresFullScreen key, I lose the full split-screen functionality - only "slide over" is available because that doesn't affect my app's use of the full device screen.

The "Device Orientation" checkboxes are for the default plist values. The only way they wouldn't affect the app on the iPad is if there's a more specific value in the plist, therefore a value specifically for iPad.

When the system searches for a key in your app’s Info.plist file, it chooses the key that is most specific to the current device and platform.

65
votes

Set UIRequiresFullScreen to YES in Info.plist.

enter image description here

Enjoy...!!!

8
votes

In fact, it was too easy... That's why I haven't even tried it:

Configuration

Setting Portrait for Device Orientation does not impact iPad orientation.

That means that the Device Orientation section should be renamed iPhone Orientation, indeed, with that configuration, the iPhone only supports Portrait and the iPad supports all of them. And the split-screen is still allowed as we have not checked Requires full screen.

PS: At least on Xcode 8.3.1, I have not tested it on Xcode 7.x

0
votes

For your case you can use: UISupportedInterfaceOrientations~iphone.

Change UISupportedInterfaceOrientations section in Info.plist to:

<key>UISupportedInterfaceOrientations</key>
<array>
    <string>UIInterfaceOrientationPortrait</string>
    <string>UIInterfaceOrientationPortraitUpsideDown</string>
    <string>UIInterfaceOrientationLandscapeLeft</string>
    <string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~iphone</key>
<array>
    <string>UIInterfaceOrientationPortrait</string>
</array>

This combination produces no warnings.

-4
votes

Go to Locations tab from the Preferences, locate project's derived data folder, and delete files related to the project.