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

  • Home
  • SEARCH
  • 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 979927
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T04:17:50+00:00 2026-05-16T04:17:50+00:00

Trying to wrap my head around how to structure an app around the UINavigationController.

  • 0

Trying to wrap my head around how to structure an app around the UINavigationController. It seems to me that most explanations assume that the app always starts off at the root controller and drills down from there, but I’m unclear as to how this fits in with a login/registration step that happens before you get into the app. The structure will be like this:

 Home page                                            | Main app (typical nav hierarchy)
------------                                          |---------------------------------
 Log in   ----> Login page                            | App section 1
               ------------                           | App section 2
                Do login   ------------------------>  | etc.
             <- Cancel                                |
                                                      |
 Register ------------------->  Register page         |
                               -----------------      |
                                Do registration --->  |
                             <- Cancel                |

So basically I’m assuming that the “Main app” controller should actually be the root controller of the application, correct? In which case I’m unclear on how to handle the whole process that sits in front of it (which is basically like a nav structure separate from the app nav structure). Is the “Home page” a modal controller displayed over the main app, and also a separate nav controller for the login/register steps, so that it simply gets popped after login to put us back at the app root?

Hopefully I’m just overcomplicating what is really a simple thing, just hasn’t seemed to click for me yet. Any pointers greatly appreciated.

EDIT: So here’s what I ended up with, which seems to work for what I need. I have two UINavigationControllers, both assigned to the MainWindow in IB with separate starting NIBs. One is the app startup nav controller (home/login/registration) and the other is the main app nav controller. My app delegate has this code:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    [window addSubview:startNavController.view];
    [window makeKeyAndVisible];
    return YES;
}

- (void)activateMainApp {
    [startNavController.view removeFromSuperview];
    [window addSubview:appNavController.view];
    [window makeKeyAndVisible];
}

In the last step of login/registration, I have this code that is what calls the app delegate to make the switch between nav controllers:

- (IBAction)continuePressed {
    // Transfer control to the main app nav controller:
    MyAppDelegate *app = (MyAppDelegate*)[[UIApplication sharedApplication] delegate];
    [app activateMainApp];
    [app release];
}

I suspect that I could have accomplished this with one nav controller, but this made logical sense to me based on my view structure and seems to work, and I end up with the main home view as the app nav controller’s root view, as desired. Any additional feedback is appreciated if there’s something bone-headed about this.

  • 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-05-16T04:17:50+00:00Added an answer on May 16, 2026 at 4:17 am

    You can create a UINavigationController at any stage, including after your login screen – just make it a subview of the view you want to start using it on. You will see the view controller (which you made the root view of the new nav controller) at that point. Once you have it you can push new view controllers onto the navigation stack. You can look at the navigation stack

    There is nothing really special about the root controller except that you can get there in one call (popToRootViewControllerAnimated) and that you can’t pop further than that. All of the view controllers managed by the navigation controller are just on a stack so you can push onto the stack or pop off the stack as you like.

    I think of it as a thing that is useful when the Back arrow will be useful.

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

Sidebar

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.