Fix iOS programmatically orientation crash on OS below 16 (#7112) (#7114)

(cherry picked from commit 76c8f844f9)

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
This commit is contained in:
Mattermost Build
2023-02-14 17:24:29 +02:00
committed by GitHub
parent 24ee8cc98e
commit a9f325ef43

View File

@@ -59,7 +59,7 @@ class SplitViewModule: RCTEventEmitter {
DispatchQueue.main.async {
let appDelegate = UIApplication.shared.delegate as! AppDelegate
appDelegate.allowRotation = true
UIDevice.current.setValue(UIInterfaceOrientation.unknown, forKey: "orientation")
UIDevice.current.setValue(UIInterfaceOrientation.unknown.rawValue, forKey: "orientation")
}
}
@@ -68,8 +68,8 @@ class SplitViewModule: RCTEventEmitter {
DispatchQueue.main.async {
let appDelegate = UIApplication.shared.delegate as! AppDelegate
appDelegate.allowRotation = false
UIDevice.current.setValue(UIInterfaceOrientation.unknown, forKey: "orientation")
UIDevice.current.setValue(UIInterfaceOrientation.portrait, forKey: "orientation")
UIDevice.current.setValue(UIInterfaceOrientation.unknown.rawValue, forKey: "orientation")
UIDevice.current.setValue(UIInterfaceOrientation.portrait.rawValue, forKey: "orientation")
}
}
}