I have this app I am working on and I need ALL my view controllers but one to be in portrait. The single one view controller that is special I need it to be able to rotate to whatever orientation the phone is in.
To do that I present it modally (not embedded in a NavigationController)
So (for example) my structure is like this:
- window - Portrait
- root view controller (UINavigationController - Portrait)
- home view controller (UIViewController - Portrait)
- details view controller (UIViewController - Portrait)
- .
- .
- .
- modal view controller (UIVIewController - All)
- home view controller (UIViewController - Portrait)
- root view controller (UINavigationController - Portrait)
Now when ever I dismiss my modal view controller in a landscape position my parent view controller is ALSO rotated even though it doesn't support that orientation.
All UIViewControllers
and UINavigaionControllers
in the app inherit from the same general classes which have these methods implemented:
override func supportedInterfaceOrientations() -> Int
{
return Int(UIInterfaceOrientationMask.Portrait.toRaw())
}
My modal view controller overrides this method once again and it looks like this:
override func supportedInterfaceOrientations() -> Int
{
return Int(UIInterfaceOrientationMask.All.toRaw())
}
Update 1
It looks like this is happening only on iOS8 Beta. Does someone know if there is something that changed regarding view controller's rotation or is this just a bug in the beta?