How do I add an action to a Tab Bar Item when it is pressed. I've tried a few things, but either they aren't right, or I'm putting them in the right location.
In my storyboard, I have a tab view controller, which is connected to a navigation controller, and that is of course connected to a ViewController. I've tried using
func tabBar(tabBar: UITabBar, didSelectItem item: UITabBarItem) {
//This method will be called when user changes tab.
}
I added UITabBarDelegate
, and it sill doesn't work? Any ideas? Thanks!