LeadKit/Sources/Extensions/UIKit/UIDevice/UIDevice+ScreenOrientation....

14 lines
437 B
Swift
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import UIKit
public extension UIDevice {
/// Вручную повернуть экран устройства
///
/// - Parameters:
/// - orientation: ориентация в терминах ScreenOrientation
func rotateManually(to orientation: UIInterfaceOrientation) {
UIDevice.current.setValue(orientation, forKey: "orientation")
UIViewController.attemptRotationToDeviceOrientation()
}
}