views:

274

answers:

2

Is there a way to use UITabbaritem as a UIButton? I am trying to make a Tabbar that its items don't change the view. Just want them to do simple actions in the same view controller.

Thanks.

+1  A: 

No. It inherits from UIBarItems:NSObject. UIButton inherits from UIControl.

Macmade
+3  A: 

It's probably possible, by creating a UITabBarDelegate and implementing the correct methods, but doing so would violate Apple's HIG and cause your app to be rejected. UIToolbar is the correct class to use for what you're describing. From that doc:

A tab bar gives users the ability to switch among different modes or views in an application, and users should be able to access these modes from everywhere in the application. However, a tab bar should never be used as a toolbar, which contains buttons that act on elements in the current mode (see “Toolbars” for more information on toolbars).

Ian Henry
Thank you, very helpful.
Adhamox