I have a UITabBarController subclass and it has the below code:
class TabBarController: UITabBarController {
// MARK: Methods
override func viewDidLoad() {
super.viewDidLoad()
}
override func supportedInterfaceOrientations() -> UIInterfaceOrientationMask {
print(self.selectedIndex)
if self.selectedIndex == 1 {
return .Portrait
}
return .All
}
}
The function supportedInterfaceOrientations is only called when I execute the app from an iphone. If I execute the app from my iPad mini it is not called. Any idea of the reason of this behaviour?
It is very strange, but if I deselect Upside Down from the device orientation for iPads supportedInterfaceOrientations is called.

UPDATE:
If 'Requires full screen' setting from 'General' is enable, will allow the orientation delegate methods shouldAutorotate, preferredInterfaceOrientation, and supportedInterfaceOrientations to fire.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With