I'm using YALFoldingTabBar for a project https://github.com/Yalantis/FoldingTabBar.iOS
I want to change its behavior a bit, by showing the current ViewController as the centerButtonImage, instead of a plus/cross sign.
I've tried to override didSelectItem
like this:
override func tabBar(tabBar: UITabBar, didSelectItem item: UITabBarItem!) {
switch(self.selectedIndex)
{
case 0:
self.centerButtonImage = UIImage(named: "whatever")
default:
//Change image
}
switch (self.selectedViewController)
{
case 0 as GameViewController:
//Change image
default:
//Change image
}
}
The code below is in my CustomTabBar
, subclassing YALFoldingTabBarController
.
But it doesn't seem to work that way. I've also tried to manipulate the tabBar in the specific UIViewControllers
's viewDidLoad
or viewDidAppear
but it seems like the tabBar is set only.
Is this possible, and if so, what am I doing wrong?
EDIT: It seems like the method is not called, when changing viewController.