diff --git a/Sources/Classes/Controllers/BaseConfigurableController.swift b/Sources/Classes/Controllers/BaseConfigurableController.swift index 388cab40..fc50616e 100644 --- a/Sources/Classes/Controllers/BaseConfigurableController.swift +++ b/Sources/Classes/Controllers/BaseConfigurableController.swift @@ -51,7 +51,7 @@ open class BaseConfigurableController: UIViewController, Configurable } open override var preferredInterfaceOrientationForPresentation: UIInterfaceOrientation { - return forcedInterfaceOrientation ?? super.preferredInterfaceOrientationForPresentation + forcedInterfaceOrientation ?? super.preferredInterfaceOrientationForPresentation } /// Initializer with view model parameter. diff --git a/Sources/Classes/Controllers/BaseOrientationNavigationController.swift b/Sources/Classes/Controllers/BaseOrientationNavigationController.swift index c24c0110..9c431a9f 100644 --- a/Sources/Classes/Controllers/BaseOrientationNavigationController.swift +++ b/Sources/Classes/Controllers/BaseOrientationNavigationController.swift @@ -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 } diff --git a/Sources/Extensions/UIKit/UIDevice/UIDevice+ScreenOrientation.swift b/Sources/Extensions/UIKit/UIDevice/UIDevice+ScreenOrientation.swift index 49ba8e33..e4dbec26 100644 --- a/Sources/Extensions/UIKit/UIDevice/UIDevice+ScreenOrientation.swift +++ b/Sources/Extensions/UIKit/UIDevice/UIDevice+ScreenOrientation.swift @@ -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() } }