Fix PR issue
This commit is contained in:
parent
98e0e34afe
commit
ab09d9e289
|
|
@ -51,7 +51,7 @@ open class BaseConfigurableController<ViewModel>: UIViewController, Configurable
|
|||
}
|
||||
|
||||
open override var preferredInterfaceOrientationForPresentation: UIInterfaceOrientation {
|
||||
return forcedInterfaceOrientation ?? super.preferredInterfaceOrientationForPresentation
|
||||
forcedInterfaceOrientation ?? super.preferredInterfaceOrientationForPresentation
|
||||
}
|
||||
|
||||
/// Initializer with view model parameter.
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
import RxSwift
|
||||
import UIKit
|
||||
|
||||
open class OrientationNavigationController: UINavigationController {
|
||||
|
|
@ -6,19 +5,19 @@ open class OrientationNavigationController: UINavigationController {
|
|||
// MARK: - Public properties
|
||||
|
||||
open override var shouldAutorotate: Bool {
|
||||
return presentedViewController?.shouldAutorotate
|
||||
presentedViewController?.shouldAutorotate
|
||||
?? topViewController?.shouldAutorotate
|
||||
?? super.shouldAutorotate
|
||||
}
|
||||
|
||||
open override var supportedInterfaceOrientations: UIInterfaceOrientationMask {
|
||||
return presentedViewController?.supportedInterfaceOrientations
|
||||
presentedViewController?.supportedInterfaceOrientations
|
||||
?? topViewController?.supportedInterfaceOrientations
|
||||
?? super.supportedInterfaceOrientations
|
||||
}
|
||||
|
||||
open override var preferredInterfaceOrientationForPresentation: UIInterfaceOrientation {
|
||||
return presentedViewController?.preferredInterfaceOrientationForPresentation
|
||||
presentedViewController?.preferredInterfaceOrientationForPresentation
|
||||
?? topViewController?.preferredInterfaceOrientationForPresentation
|
||||
?? super.preferredInterfaceOrientationForPresentation
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,9 +6,8 @@ public extension UIDevice {
|
|||
///
|
||||
/// - Parameters:
|
||||
/// - orientation: ориентация в терминах ScreenOrientation
|
||||
func rotateOrientationManually(to orientation: UIInterfaceOrientation) {
|
||||
let orientationValue = Int(orientation.rawValue)
|
||||
UIDevice.current.setValue(orientationValue, forKey: "orientation")
|
||||
func rotateManually(to orientation: UIInterfaceOrientation) {
|
||||
UIDevice.current.setValue(orientation, forKey: "orientation")
|
||||
UIViewController.attemptRotationToDeviceOrientation()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue