Reordering view controllers in a UITabBarController, all defined in a Storyboard

idStar picture idStar · Jul 3, 2012 · Viewed 13.7k times · Source

I'd like to change the order of view controllers attached to a UITabBarController, within my Storyboard, without disconnecting all view controllers and reconnecting them in the desired order.

My Question: Can this be done just via the Storyboard IB UI?

Discussion

I'm looking for some inspector panel where I can move items up and down in that list of view controllers that feeds the viewControllers property on UITabBarController.

several view controllers linked to tab bar controller

I've got a lot of tabs and so I'm hoping to not have to disconnect everything and reconnect, just to change the order.

I even tried changing the 'tag' value on the Bar Item, in the inspector, but that value was also ignored at runtime (I believe it is for identification purposes, not for ordering).

Tag set on Bar Item

Answer

rockstarberlin picture rockstarberlin · Jul 3, 2012

enter image description here

you can simply drag and drop and resort them with the mouse in the storyboard. it still works in 4.5.1

EDIT

maybe you have first to switch the storyboard view to "Source Code" and go back before you can drag. right-click the storyboard file and select "Open as" -> "Source Code" and then back again "Open as" -> "Interface Builder - iOS Storyboard". that should do the trick.

EDIT

Does not work in Xcode 4.5.2 anymore for me!

EDIT

In Xcode 5 preview 5 it works again. Seems that Apple did fix this bug in the new verion

enter image description here