Open
Description
Do your libraries interfere with the device's screen rotation? The screen rotation lock feature works well, but when adding FURenderKit, it doesn't work on devices older than iOS 16.
Hear is my code
public static func lockToOrientation(newOrientation: UIInterfaceOrientation, using mask: UIInterfaceOrientationMask) {
instance.orientationMark = mask
if #available(iOS 16.0, *) {
if let windowScence = instance.getWindowScence() {
let windowScenceGeometry = UIWindowScene.GeometryPreferences.iOS(interfaceOrientations: mask)
windowScence.requestGeometryUpdate(windowScenceGeometry) { error in
print("Update Geometry error : \(error.localizedDescription)")
}
}
} else {
UIDevice.current.setValue(UIInterfaceOrientation.unknown.rawValue, forKey: "orientation")
UIDevice.current.setValue(newOrientation.rawValue, forKey: "orientation")
FURenderer.setDeviceOrientation(Int32(mask.toFUImageOrientation.rawValue))
}
UIViewController.attemptRotationToDeviceOrientation()
}
Metadata
Metadata
Assignees
Labels
No labels