Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Moving existing segue(s)

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?

like image 950
tlbrack Avatar asked Dec 21 '12 15:12

tlbrack


1 Answers

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.

like image 66
Rob Avatar answered Oct 03 '22 05:10

Rob