iOS 9 : Warning "All interface orientations must be supported unless the app requires full screen" for universal app

IosIphoneXcodeIpadMultitasking

Ios Problem Overview


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

Ios Solutions


Solution 1 - Ios

Set UIRequiresFullScreen to YES in Info.plist.

enter image description here

Enjoy...!!!

Solution 2 - Ios

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.

Solution 3 - Ios

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

Solution 4 - Ios

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.

Solution 5 - Ios

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

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionZaphodView Question on Stackoverflow
Solution 1 - Iosmital solankiView Answer on Stackoverflow
Solution 2 - IossiburbView Answer on Stackoverflow
Solution 3 - IosZaphodView Answer on Stackoverflow
Solution 4 - Iostier777View Answer on Stackoverflow
Solution 5 - IosOrdoDeiView Answer on Stackoverflow