FixRotation: Create extension UIDeviceOrientation + Add property Boolean .isRotateAllowed, .face
This commit is contained in:
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
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user