Reputation: 3243
In my app I have a tab bar at the bottom with 4 tab bar items, and what I want to do is run a method when a given tab bar item is pressed.
How can I do this?
The purpose of the methods is to send a javascript string/command to the same webview.
Upvotes: 0
Views: 1612
Reputation: 31304
This is pretty straightforward: just use the UITabBarDelegate
which lets you get callbacks whenever a tab bar item is selected.
See the Apple reference here:
...and you want to look in particular at the tabBar:didSelectItem:
method.
Upvotes: 3