How can I rearrange UITabBarController items using the Storyboard?

23,860

Solution 1

In the storyboard highlight the tab bar controller.

Make sure you are zoomed in enough and that a blue box is around the tab bar controller.

Then click on the tabs and drag them around to where you want them

Solution 2

I solved this by right-clicking on the storyboard -> open as source code, and then rearranged the "segue" xml-blocks in the order I wanted them to be.

Solution 3

xcode 4.5, drag and drop failed. as suggested by another, close xcode and restart xcode. after this drag and drop of tabBarItems worked perfectly to rearrange order.

Solution 4

I could not drag and tabs around while i had the tab bar controller as root view of navigation controller. I had to delete the navigation controller and restart xcode (4.5.2)

Solution 5

Some of the suggestions above worked for me sometimes, but not always. Even rebooting the Mac did not help.
The only way I found that works always is deleting all segues from the tab bar controller to its child view controllers, and reconnecting them in the right order.

Share:
23,860
itsjavi
Author by

itsjavi

https://blog.itsjavi.com

Updated on July 05, 2022

Comments

  • itsjavi
    itsjavi almost 2 years

    Hi I have a UITabBarController in XCode 4.5 as the root controller with many tabs I need to change the order to.

    The only thing that works for me is remove the relationships and add them again in the desired order that I want the tabbar items to appear.

    Is there another way to do this?

    thanks

  • Bazze
    Bazze over 11 years
    Well this doesn't do it for me, I can't rearrange them by dragging and dropping. Has this changed in iOS 6?
  • MobileMon
    MobileMon over 11 years
    @Bazze make sure you are on the tab bar controller and not a view controller for 1 of the tabs
  • Bazze
    Bazze over 11 years
    @MobileMon I was in the tab bar controller, but it seems like it was some kind of temporary bug. I restarted XCode and now it works just fine.
  • antf
    antf over 11 years
    I just faced the same thing and yes it is a bug but you don't need to restart Xcode, just click on any .h or .m file then click back on the story board it should work normally.
  • PJR
    PJR over 11 years
    there may be some other issue , did u checked that it is "Zoomed out" enough ?
  • Tom
    Tom over 11 years
    It does not work. XCode 4.5.2. Very-very annoying bug, drives me crazy
  • Felipe Plets
    Felipe Plets about 7 years
    Shame on Apple that still on Xcode 8.2.1 we still need to open Storyboard as source code and move segues to solve this.
  • manar
    manar almost 6 years
    May sound stupid but clicking the tab item won't highlight it until you try to drag it.
  • dgarbacz
    dgarbacz about 5 years
    This worked for me using Xamarin in Visual Studio! Had to close the Storyboard, but opening the file in a text editor and finding what my TabBarController was named, you can easily rearrange based on the order they're in. Save it, re-open in Visual Stuido, worked great! Thanks!
  • Ugo
    Ugo over 3 years
    This answer worked perfectly for me in Xcode 12.0, thanks.