Skip to content

Commit d5bbff7

Browse files
author
emilylaguna
committed
Disable landscape on the enable notifications prompt
1 parent 6a61389 commit d5bbff7

2 files changed

Lines changed: 20 additions & 2 deletions

File tree

WordPress/Classes/ViewRelated/Blog/Onboarding Questions Prompt/OnboardingEnableNotificationsViewController.swift

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,18 @@ class OnboardingEnableNotificationsViewController: UIViewController {
2222
override func viewDidLoad() {
2323
super.viewDidLoad()
2424

25+
navigationController?.navigationBar.isHidden = true
26+
navigationController?.delegate = self
27+
2528
applyStyles()
2629
updateContent()
2730

2831
coordinator.notificationsDisplayed(option: option)
2932
}
33+
34+
override var supportedInterfaceOrientations: UIInterfaceOrientationMask {
35+
return [.portrait, .portraitUpsideDown]
36+
}
3037
}
3138

3239
// MARK: - IBAction's
@@ -56,6 +63,17 @@ extension OnboardingEnableNotificationsViewController {
5663
}
5764
}
5865

66+
// MARK: - UINavigation Controller Delegate
67+
extension OnboardingEnableNotificationsViewController: UINavigationControllerDelegate {
68+
func navigationControllerSupportedInterfaceOrientations(_ navigationController: UINavigationController) -> UIInterfaceOrientationMask {
69+
return supportedInterfaceOrientations
70+
}
71+
72+
func navigationControllerPreferredInterfaceOrientationForPresentation(_ navigationController: UINavigationController) -> UIInterfaceOrientation {
73+
return .portrait
74+
}
75+
}
76+
5977
// MARK: - Private Helpers
6078
private extension OnboardingEnableNotificationsViewController {
6179
func applyStyles() {

WordPress/Classes/ViewRelated/Blog/Onboarding Questions Prompt/OnboardingQuestionsPromptViewController.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import UIKit
22
import WordPressUI
33
import WordPressShared
44

5-
class OnboardingQuestionsPromptViewController: UIViewController, UINavigationControllerDelegate {
5+
class OnboardingQuestionsPromptViewController: UIViewController {
66
@IBOutlet weak var stackView: UIStackView!
77
@IBOutlet weak var titleLabel: UILabel!
88

@@ -120,7 +120,7 @@ private extension OnboardingQuestionsPromptViewController {
120120
}
121121

122122
// MARK: - UINavigation Controller Delegate
123-
extension OnboardingQuestionsPromptViewController {
123+
extension OnboardingQuestionsPromptViewController: UINavigationControllerDelegate {
124124
func navigationControllerSupportedInterfaceOrientations(_ navigationController: UINavigationController) -> UIInterfaceOrientationMask {
125125
return supportedInterfaceOrientations
126126
}

0 commit comments

Comments
 (0)