FixRotation: Create extension UIDeviceOrientation + Add property Boolean .isRotateAllowed, .face

This commit is contained in:
rmotygullin committed 2021-11-04 14:01:00 +03:00
1 parent 410f53dc1c
commit 08975badd3
1 file changed
+14
@@ -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
}
}
}