Fix PR issue from Ivan Smolin
This commit is contained in:
parent
f62ad5be5f
commit
0bc80d98b8
|
|
@ -31,12 +31,8 @@ open class BaseConfigurableController<ViewModel>: UIViewController, Configurable
|
|||
/// A view model instance used by this controller.
|
||||
public let viewModel: ViewModel
|
||||
|
||||
override var interfaceOrientation: UIInterfaceOrientation {
|
||||
return forcedInterfaceOrientation ?? super.interfaceOrientation
|
||||
}
|
||||
|
||||
open override var supportedInterfaceOrientations: UIInterfaceOrientationMask {
|
||||
switch interfaceOrientation {
|
||||
switch forcedInterfaceOrientation {
|
||||
case .landscapeLeft:
|
||||
return .landscapeLeft
|
||||
|
||||
|
|
@ -50,12 +46,12 @@ open class BaseConfigurableController<ViewModel>: UIViewController, Configurable
|
|||
return .portraitUpsideDown
|
||||
|
||||
default:
|
||||
return .portrait
|
||||
return super.supportedInterfaceOrientations
|
||||
}
|
||||
}
|
||||
|
||||
open override var preferredInterfaceOrientationForPresentation: UIInterfaceOrientation {
|
||||
return interfaceOrientation
|
||||
return forcedInterfaceOrientation ?? super.preferredInterfaceOrientationForPresentation
|
||||
}
|
||||
|
||||
/// Initializer with view model parameter.
|
||||
|
|
|
|||
|
|
@ -8,18 +8,18 @@ open class OrientationNavigationController: UINavigationController {
|
|||
open override var shouldAutorotate: Bool {
|
||||
return presentedViewController?.shouldAutorotate
|
||||
?? topViewController?.shouldAutorotate
|
||||
?? false
|
||||
?? super.shouldAutorotate
|
||||
}
|
||||
|
||||
open override var supportedInterfaceOrientations: UIInterfaceOrientationMask {
|
||||
return presentedViewController?.supportedInterfaceOrientations
|
||||
?? topViewController?.supportedInterfaceOrientations
|
||||
?? .portrait
|
||||
?? super.supportedInterfaceOrientations
|
||||
}
|
||||
|
||||
open override var preferredInterfaceOrientationForPresentation: UIInterfaceOrientation {
|
||||
return presentedViewController?.preferredInterfaceOrientationForPresentation
|
||||
?? topViewController?.preferredInterfaceOrientationForPresentation
|
||||
?? .portrait
|
||||
?? super.preferredInterfaceOrientationForPresentation
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue