Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9308265
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 19, 20262026-06-19T00:35:23+00:00 2026-06-19T00:35:23+00:00

I am trying to follow a previous question in allowing a navigation controller view

  • 0

I am trying to follow a previous question in allowing a navigation controller view controllers in having different orientation rules. Previous Question

So for example, I have two view controllers the first is a Welcome the second Home. I would like the first view controller to only be Potrait and the second (Home) to allow both Port/Landscape.

I am not sure I quite understand in full how to complete this. Once I do, I intend to create a seperate project explaining how to do this and add to Github/share on the question for future reference.

In this particular project I am using a side view controller github project. PPRevealSideViewController.

My app Delegate is the following:

// Then we setup the reveal side view controller with the root view controller as the navigation controller
welcomeViewController = [[MESWelcomeViewController alloc] init];
UINavigationController *navController = [[MESNavViewControllerSubClass alloc] initWithRootViewController:welcomeViewController];


self.revealSideViewController = [[PPRevealSideViewController alloc] initWithRootViewController:navController];
[self.revealSideViewController setDirectionsToShowBounce:PPRevealSideDirectionNone];
[self.revealSideViewController setPanInteractionsWhenClosed:PPRevealSideInteractionContentView | PPRevealSideInteractionNavigationBar];

//self.window.rootViewController = welcomeViewController;
self.window.rootViewController = self.revealSideViewController;
[self.window makeKeyAndVisible];

From the above you can see I have subclassed the Navigation Controller as MESNavViewController. This is my head for this file:

@interface MESNavViewControllerSubClass : UINavigationController {
    BOOL setLandscapeOK;
}

Imp file for MESNavViewController:

-(void)viewDidLoad {
    NSLog(@"subclass called");
}

- (BOOL)shouldAutorotate
{
    return YES;
}

- (NSUInteger)supportedInterfaceOrientations
{
    if (self->setLandscapeOK) {
        // for iPhone, you could also return UIInterfaceOrientationMaskAllButUpsideDown
        return UIInterfaceOrientationMaskAll;
    }
    return UIInterfaceOrientationMaskPortrait;
}

In my first (Welcome) View controller I have the following:

-(void)viewWillAppear {
    BOOL setLandscapeOK = NO;
}
- (NSInteger)supportedInterfaceOrientations {
    // Restriction for the welcome page to only allow potrait orientation
    return UIInterfaceOrientationMaskPortrait;
}

In my second (Home) View controller I have only the following:

-(void)viewWillAppear {
    BOOL setLandscapeOK = YES;
}

What I am seeing is both view controllers within the nav allow either orientation. I am not sure I quite understand it correctly. Hopefully I have provided enough information.

EDIT —–
I have updated the PPRevealSidePanel sub class which is the very top level controller. This then holds the nav controller, which in turn holds the view controller. The orientation should be decided by the view controller displayed.

PPRevealSidePanel Sub class –
enter image description here

Secondly I receive an error trying to update the setter setLandscapeOK for this sub class, on the actual view controller.
Login View controller –
enter image description here

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-19T00:35:24+00:00Added an answer on June 19, 2026 at 12:35 am

    Can you check the below thread which talks about handling orientation with nav controllers

    NavController ShouldAutorotate

    -anoop

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is a follow up question to my previous question . I am trying
This is a follow up question to my previous question . I am trying
This is a follow up to my previous AngularJS question . I am trying
This is a follow-up question of my previous post . I am trying to
I'm trying to follow up on a previous Stackoverflow question about how to display
This question is a follow up to a previous question I had I'm trying
note: this is a direct follow up to this previous question I have very
This is a follow up to a previous question. I'm trying to convert some
So this is a follow-up to a previous question that I asked: Trying to
Trying to follow this example. (Section String sorting...) Is there anything obvious that would

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.