nick364
nick364

Reputation: 33

How to run code when a item on the tab bar is pressed?

How to run code when a item on the tab bar is pressed? I am using the Tab Bar template.

Upvotes: 1

Views: 222

Answers (2)

Touhid Ahmed
Touhid Ahmed

Reputation: 1

Toolbar buttons are similar to standard buttons. Therefore, you can also set IBAction by control dragging from the Bar Buttons to your view controllers header file and write your own action code.

Upvotes: 0

Nick Weaver
Nick Weaver

Reputation: 47241

Use the UITabBarControllerDelegate protocol and implement tabBarController:didSelectViewController: to run your code.

Upvotes: 2

Related Questions