Fix PR issue

This commit is contained in:
Boyko Mihail 2020-09-24 18:36:35 +03:00
parent 98e0e34afe
commit ab09d9e289
3 changed files with 6 additions and 8 deletions

View File

@ -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.

View File

@ -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
}

View File

@ -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()
}
}