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 9309959
In Process

The Archive Base Latest Questions

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

I am currently building an app for iPad where the view structure is completely

  • 0

I am currently building an app for iPad where the view structure is completely different depending on the device orientation.

When the app is in portrait I am using the ECSlidingViewController library to support left and right sliding menu’s (like facebook or path).

When the app is in landscape I need to display a splitviewcontroller so that the left hand menu is always visible.

Does anybody know of the best solution to this problem?

I have tried changing the RootViewController of the UIWindow when an orientation change is detected but this gave some very strange results….

  • 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:59:50+00:00Added an answer on June 19, 2026 at 12:59 am

    There are several ways to do this. Some better than other, but mostly it will depends on the needs of your specific situation.

    1. Replace the rootViewController as you mentioned during rotation.
    2. Always use a UISplitViewController and use a segue to with replace to replace the detailViewController when rotating between portrait and landscape.
    3. Use/make a custom container view controller which adds/removes the appropriate view controller on rotation using addChildViewController: and removeFromParentViewController:

    Extremely crude example of choice 3.

    - (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {
        [self.childViewControllers[0].view removeFromSuperView];
        [self.childViewControllers[0] removeFromParentViewController];
    
        if (UIInterfaceOrientationIsPortrait(toInterfaceOrientation)) {
            [self addChildViewController:portraitVC];
            [self.view addSubview:portraitVC.view];
        } else {
            [self addChildViewController:landscapeVC];
            [self.view addSubview:landscapeVC.view];
        }
    }
    

    From what you’ve said, I’d guess option 3 would be the best fit. All this said though, I’m not entirely convinced you need to be switching view controllers, but I’m not familiar with ECSlidingViewController and what it offers so I’m can’t be certain.

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

Sidebar

Related Questions

I'm building a simple puzzle app for and iPad using a JavaScript library for
I am currently building a Flex 4 web app using PHP as my backend.
I'm building a web app through the iPad in kiosk mode using the 320
I am currently building an app that has 6 images on the main view
I am currently building an App using CocoaAsyncSocket. I connect to a TCP server
I am currently building a WP7 app using the MVVMLight framework. I would like
I am currently building an web app using mostly PHP and JavaScript. What is
I am currently building an Iphone app that is using storyboards. I know how
I'm currently building an app for deployment to GAE, using Objectify 3.1. I am
I am currently building a web app using java, java script and google app

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.