FrediWeber
FrediWeber

Reputation: 1099

UITabbarController enable editing in more tab

How can I enable editing in the more tab? I can click on edit and see the items but I can't move them. Is there a option in UITabbarController?

Upvotes: 2

Views: 1190

Answers (2)

Ahti
Ahti

Reputation: 1430

Set tabBarController.customizableViewControllers to something, the easiest case would be:

tabBarController.customizableViewControllers = tabBarController.viewControllers;

after you set up the viewControllers.

Upvotes: 1

spacebiker
spacebiker

Reputation: 3865

You use the UITabBarControllerDelegate protocol when you want to augment the behavior of a tab bar. In particular, you can use it to determine whether specific tabs should be selected, to perform actions after a tab is selected, or to perform actions before or after the user customizes the order of the tabs. After implementing these methods in your custom object, you should then assign that object to the delegate property of the corresponding UITabBarController object.

First of all define outlets in the app delegate and attach them on Interface Builder, i assume you know how to do this:

IBOutlet UITabBarItem *tabBarItem1;
IBOutlet UITabBarItem *tabBarItem2;
IBOutlet UITabBarItem *tabBarItem3;
IBOutlet UITabBarItem *tabBarItem4;

Then your class, probably the view controller must be UITabBarControllerDelegate and use the following hook:

- (void)tabBarController:(UITabBarController *)tabBarController willEndCustomizingViewControllers:(NSArray *)viewControllers changed:(BOOL)changed

Hope that helps !

Upvotes: 1

Related Questions