Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode - iOS - Navigation controller scene order to be changed

I have created segues in the following way:

  • view controller VC1 is the root view controller
  • a segue from view controller from VC1 to VC2

In Xcode there is a section that shows the navigation controller scene (as shown in the attachment)

screen shot of the navigation controller scene, pls see the red rectangle

The navigation controller scene shows in the following order:

  • VC2
  • Navigation controller
  • VC1

Question:

Though everything works as expected, I would like to change the order in which the navigation controller scene is displayed

The order of the navigation controller doesn't reflect the way the segues are connected

Is there a way to manually change the order without having to delete the view controllers and recreating them (pls see the attached pic) ?

like image 500
user1046037 Avatar asked Sep 25 '26 13:09

user1046037


1 Answers

Open your storyboard file with a text editor (it's XML) and find something like , then you should see:

<!--VC1-->
   <scene sceneID="...">
        ....
   </scene>
<!--Navigation Controller-->
   <scene sceneID="..">
        ....
   </scene>

Just change the order ^^

EDIT:

By "change the order" I mean mean rearrange the entire block, be careful to not mess up your file.

like image 54
fbernardo Avatar answered Sep 27 '26 02:09

fbernardo



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!