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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T21:25:42+00:00 2026-05-16T21:25:42+00:00

I am developing an app but have yet to get the optimal navigation flow

  • 0

I am developing an app but have yet to get the optimal navigation flow working.

To give you an idea of the structure of my app, I have a main view that allows the user to start a new game or view high scores. At the end of a game, I would like to give the user the choice of viewing high scores or going back to the main menu – I have a game over view for this.

The hierarchy looks something like this:

Main View
|
+--Game View
|  |
|  +--Game Over View
|     |
|     +--High Scores View
|
+--High Scores View

I am using the presentModalViewController method to switch from the game view to the game over view. This is fine, but when I want to go back to the main view I have two layers of views to navigate through (I want to close the game over view AND the game view to return straight to the main view). To close views I am using dismissModalViewControllerAnimated but this is not ideal for traversing more than one view. Is there a way of replacing the current model view rather than opening a new one on top?

I hope this makes sense. Please let me know if you need anymore details.

Thanks in advance for any help.

Alan

  • 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-16T21:25:42+00:00Added an answer on May 16, 2026 at 9:25 pm

    In addition to Alexsander’s great suggestion, you can eschew the use of presentModelViewController:animated: altogether. Instead, just set the rootViewController property of the active UIWindow.

    After setting aViewController as the rootViewController, call [aViewController.view becomeFirstResponder]; to enable it to respond to touch input.


    If presentModelViewController:animated: is like calling a method, setting rootViewController is like a goto. I think a “goto” could be more appropriate here because of the cyclic nature of the order in which views can be presented:

    Main View -> Game View -> Game Over View -> Main View -> Game View -> Game Over View -> etc.

    • 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.