Closed leewonghao closed 7 years ago
You should be able to override an existing style, and hook into animateTabTransition
function.
class TestStyle:ElegantTabBarStyle {
override func animateTabTransition(tabBar: SimpleTabBar, toIndex: Int,fromIndex: Int) {
super.animateTabTransition(tabBar: tabBar, toIndex: toIndex, fromIndex: fromIndex)
print(fromIndex, toIndex)
}
}
And then in AppDelegate
, load the style like this:
let style:SimpleTabBarStyle = TestStyle(tabBar: simpleTBC!.tabBar)
fromIndex
and toIndex
should help you determine which tab item got selected and unselected.
This is so helpful. Thank you for supported my question.
I want to detected method event didSelect if i when press item on tabbar navigation to another view controller.
Please help me! thank you.