Note that there are some explanatory texts on larger screens.

plurals
  1. PONavigate between views embedded in NavigationController using buttons in Storyboard
    primarykey
    data
    text
    <p>My app starts with a view with some buttons. I want to navigate to different views depending on the button pressed and pass them different parameters.</p> <p>My storyboard looks as follows:</p> <p><img src="https://i.stack.imgur.com/h7wQF.png" alt="enter image description here"> .</p> <p>As you can see, pressing a button in the main view calls a table view embedded in a navigation controller. And this is causing to me a lot of problems!</p> <p>At first I don't know if I've chosen the right approach, or if I've to start my app with a navigation controller instead of a view (I've tried this solution, but in my home page I don't want a navigation bar, and also making it visible or not, isn't really nice visually).</p> <p>In case you confirm the feasibility of my initial approach, how can I navigate to the desired view also passing some parameters?</p> <p><strong>------Edit:</strong></p> <p>I finally found a working solution. The Navigation controller is the first controller in my application. Views are connected with standard segue.</p> <p>In my home view:</p> <pre><code>- (void)viewWillAppear:(BOOL)animated { [[self navigationController] setNavigationBarHidden:YES animated:YES]; } </code></pre> <p>In my table view:</p> <pre><code>- (void)viewWillAppear:(BOOL)animated { [[self navigationController] setNavigationBarHidden:NO animated:YES]; } </code></pre> <p>In this way, when you push the button, the new view is displayed with an animation, that is the same of the navigation bar. And the same happens when you press the back button in the table view.</p> <p>No more lines of code are needed!!!</p> <p>The only addiction you can do to make it perfect, is to manage the first time the app is loaded to hide the navigation bar in the home view without animation.</p> <p>yassa</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload