Improving Storyboard Segues With IBSegueAction | raywenderlich.com

In this iOS tutorial, you’ll learn how to use IBSegueAction for storyboard segues. You’ll understand the advantages and disadvantages of this new technique.


This is a companion discussion topic for the original entry at https://www.raywenderlich.com/9296192-improving-storyboard-segues-with-ibsegueaction

What if destination controller wrapped in navigation controller?

Could you expand your question with more details? I’m not sure I understand what you would like to know.

If your destination wrapped in navigation controller than the coder that you get inside @IBSegueAction method will be able to instantiate only instance of navigation controller.

In this case it will be impossible to pass data to your controller, it will be instantiate inside storyboards.

So I was wondering what possible workaround we can use in this case?

@krissense Great question. I hope that in the next iteration of this tutorial they can give an example with a ViewController embedded in a NavigationController. You would define your @IBSegueAction the same as before. This post on stackoverflow.com walks you through how to do it and even has an example project on GitHub you can download.

Yeah, I’ve seen that post, but the solution isn’t perfect at all. It works only when you can ctrl-drag inside one storyboard file — a huge limitation! It seems it’s impossible to make it work with separate storyboards using storyboard reference.

I can provide my ugly workaround which has its own limitation as well.

I don’t have a solution, unfortunately. That is beyond the scope of this tutorial. If you find something, please share it and we might be able to update our tutorial in the future. You might also consider posting to our discussions on Discord. Someone there might have an idea.