Skip to content

Commit fa0bdde

Browse files
authored
Use new iOS 16 method to notify VC of supported orientation change update (#534)
1 parent 70fdf18 commit fa0bdde

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

Loop/Managers/LoopAppManager.swift

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,15 @@ class LoopAppManager: NSObject {
318318

319319
private static let defaultSupportedInterfaceOrientations = UIInterfaceOrientationMask.allButUpsideDown
320320

321-
var supportedInterfaceOrientations = defaultSupportedInterfaceOrientations
321+
var supportedInterfaceOrientations = defaultSupportedInterfaceOrientations {
322+
didSet {
323+
if #available(iOS 16.0, *) {
324+
rootViewController?.setNeedsUpdateOfSupportedInterfaceOrientations()
325+
} else {
326+
// Fallback on earlier versions
327+
}
328+
}
329+
}
322330

323331
// MARK: - Background Tasks
324332

0 commit comments

Comments
 (0)