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

This commit is contained in:
mrustaa committed 2021-11-04 14:02:00 +03:00
1 parent 72759913ae
commit ca43421a8f
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
}
}
}