I want to swap out one view controller for another in an existing XCode iOS storyboard, but I'd rather not recreate the segues going to it. Is it possible to move or adjust the destination of an existing segue?
I believe you do need to create the new segue(s), but that's as easy as control-dragging between the source of the segue and your new scene. And if your code is doing anything that requires the storyboard id (such as prepareForSegue
or performSegue
), then just apply the same storyboard id for your new segue and you don't need to change your code. If you're using a custom segue, you can just use the same segue class, so you don't need to change the code just because the destination changed. And if the source of your segue is a button or something like that, when you make the segue to the new scene, your old segue is automatically removed, so that simplifies the process, too.
In short, you probably do need to recreate the segues, but you probably don't need to change your code too much to support that.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With