Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 818
Subhash Khimani Avatar asked Jan 04 '23 21:01

Subhash Khimani


1 Answers

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

like image 121
Inder Kumar Rathore Avatar answered May 07 '23 15:05

Inder Kumar Rathore