Skip to content

Commit 69738d0

Browse files
committed
Force portrait orientation for migration screens only
1 parent f6f51b7 commit 69738d0

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

WordPress/Jetpack/Classes/ViewRelated/WordPress-to-Jetpack Migration/Common/Navigation/MigrationNavigationController.swift

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,22 @@ class MigrationNavigationController: UINavigationController {
1010
private var cancellable: AnyCancellable?
1111

1212
override var supportedInterfaceOrientations: UIInterfaceOrientationMask {
13+
if let presentedViewController {
14+
return presentedViewController.supportedInterfaceOrientations
15+
}
1316
if WPDeviceIdentification.isiPhone() {
1417
return .portrait
1518
} else {
1619
return .allButUpsideDown
1720
}
1821
}
1922

23+
// Force portrait orientation for migration view controllers only
2024
override var preferredInterfaceOrientationForPresentation: UIInterfaceOrientation {
21-
.portrait
25+
if let presentedViewController {
26+
return presentedViewController.preferredInterfaceOrientationForPresentation
27+
}
28+
return .portrait
2229
}
2330

2431
init(coordinator: MigrationFlowCoordinator, factory: MigrationViewControllerFactory) {

0 commit comments

Comments
 (0)