1

I am having a minor problem with segue using push in Xcode's storyboards. Its pretty straightforward: even with the simplest case, I can't manage to get it working.

The setup: http://d.pr/i/ahCG

Which is basically just a 1-view project, added another view controller, embedded that into a navigation controller and made the segue and setting the mode to "push". There is absolutely nothing happening when I push the test button. If I make the segue with modal however, it works fine.

What am I doing wrong?

ZygD
  • 22,092
  • 39
  • 79
  • 102

2 Answers2

7

You need to embed the source view (not the destination view) into a nav controller to do a push segue.

rickster
  • 124,678
  • 26
  • 272
  • 326
  • Any idea why this still wouldn't work even when the source view IS embedded in a nav controller? Using Xcode 5, iOS7. – jeremytripp Feb 18 '14 at 16:48
  • Not immediately, but that sounds like a good subject for a [new question](http://stackoverflow.com/questions/ask). – rickster Feb 18 '14 at 18:44
-1

You need to set the mode to "modal" instead of "push".

AC1D
  • 248
  • 5
  • 16
  • Why is using modal instead of push the wrong thing to do? – Ethan Parker Dec 11 '15 at 18:14
  • This is not wrong. Just different approach. If you use "push" you need write code for navigate but if you use "modal" this happen automatically. http://stackoverflow.com/questions/9392744/what-is-the-difference-between-modal-and-push-segue-in-storyboards – AC1D Dec 11 '15 at 18:24
  • If you need some logic between switching views use "push" if not use "modal" – AC1D Dec 11 '15 at 18:38