Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I'm not sure what you mean by "I related both views with a 'Presenting Segues' - Push modal." Are you using a navigation controller and want a push segue, or do you want to do a modal segue? A "push modal" is a contradiction in terms.</p> <p>So, let's imagine that you want a modal segue. So, you put a button on the first view, right-click and drag (or control-click and drag) from that button to the second view. </p> <p><img src="https://i.stack.imgur.com/jA3k4.png" alt="create segue 1"></p> <p>You'll get a pop up asking for type of segue. Select "modal".</p> <p><img src="https://i.stack.imgur.com/5Vivb.png" alt="create segue 2"></p> <p>And you're done transitioning from 1 to 2. No code necessary.</p> <p>If you want a button on the second view to take you back to the first view, you do <em>not</em> want a modal segue from the second view back to the first view, but rather you want to <code>dismissViewControllerAnimated</code>. You can do this via a custom segue, or easier, just have a button which calls <code>dismissViewControllerAnimated</code>. Thus, you'd add a button to the second view, and while the editor is in in "assistant" mode (where the associated .h file is showing below the interface builder; see below if you want to know how to show the .h file at the same time as the Interface Builder screen), right-click (or control-click) and drag from the button on the second view down to the second view controller's .h file:</p> <p><img src="https://i.stack.imgur.com/vgOPY.png" alt="dismiss 1"></p> <p>By the way, if you don't see the .h file there, click on the "assistant" editor button and choose "automatic" for the files to be shown down there, and you should be good:</p> <p><img src="https://i.stack.imgur.com/X9Zbu.png" alt="assistant editor"></p> <p>It will then show you a pop up asking you what you want to do. Select <code>IBAction</code> and give your new method a name:</p> <p><img src="https://i.stack.imgur.com/oNG8w.png" alt="dismiss 2"></p> <p>Then go to your code for the view controller, and add the <code>dismissViewControllerAnimated</code> code:</p> <p><img src="https://i.stack.imgur.com/S0jtb.png" alt="enter image description here"></p> <p>All that code says (and in this example, I just called my IBAction <code>dismissTwo</code>) is:</p> <pre><code>- (IBAction)dismissTwo:(id)sender { [self dismissViewControllerAnimated:YES completion:nil]; } </code></pre>
    singulars
    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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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