antiguab / BATabBarController

A TabBarController with a unique animation for selection
https://antiguab.github.io/batabbarcontroller/
MIT License
1.06k stars 131 forks source link

How to select tab item programmatically ? #25

Closed riseworld27 closed 6 years ago

riseworld27 commented 6 years ago

Thanks for your great open source.

I tried to use this method to select other tab programmatically.

[self.vc.tabBar selectedTabItem:1 animated:YES];

It works. But the selected image of previous tab still remains.

antiguab commented 6 years ago

this should be fixed in 0.1.5. Also similar to UITabBarController, the best way to programmatically switch tabs is using:

[self.vc setSelectedViewController:viewControllerAtIndex1 animated:YES];