diff --git a/Sources/ContainerController/ContainerDevice.swift b/Sources/ContainerController/ContainerDevice.swift index 897822d..7738823 100644 --- a/Sources/ContainerController/ContainerDevice.swift +++ b/Sources/ContainerController/ContainerDevice.swift @@ -120,3 +120,17 @@ open class ContainerDevice { } } } + +public extension UIDeviceOrientation { + + var isRotateAllowed: Bool { + return !(face || self == .portraitUpsideDown) + } + + var face: Bool { + switch self { + case .faceUp, .faceDown: return true + default: return false + } + } +}