How to stop landscape rotation in iPad in iOS 10 Swift 3.0 Xcode 8.2

2.1k Views Asked by At

I know this is duplicate type of question but I can not find solution of this problem. I have set oration changes in Info.plist file to stop rotation landscape mode under

Supported interface orientations (iPad)

above key value keeping only Portrait then I have check on iPad it works fine but when I have upload on app store that time it gives error as following

ERROR ITMS-90474: "Invalid Bundle. iPad Multitasking support requires these orientations: 
'UIInterfaceOrientationPortrait,UIInterfaceOrientationPortraitUpsideDown,UIInterfaceOrientationLandscapeLeft,UIInterfaceOrientationLandscapeRight'. Found 
'UIInterfaceOrientationPortrait' in bundle 'com.example.demo'."
ERROR ITMS-90474: "Invalid Bundle. iPad Multitasking support requires these orientations: 
'UIInterfaceOrientationPortrait,UIInterfaceOrientationPortraitUpsideDown,UIInterfaceOrientationLandscapeLeft,UIInterfaceOrientationLandscapeRight'. Found 'UIInterfaceOrientationPortrait' in bundle 'com.example.demo'."

that multitasking support required landscape orientations I have write following code to override rotation method but its not call when screen rotate

extension UINavigationController {
    public override func supportedInterfaceOrientations() -> Int {
        return visibleViewController.supportedInterfaceOrientations()
    }
    public override func shouldAutorotate() -> Bool {
        return visibleViewController.shouldAutorotate()
   }
}

and also try to set direct value on navigationController object then it gives error:

read only property can not assign value

1

There are 1 best solutions below

2
On BEST ANSWER

The problem is that your application supports multitasking which requires all the interface orientation.

Either support all orientation or just check the following flag

enter image description here