Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UITabBarControllerDelegate Doesn't work #42

Closed
aalzanki opened this issue Jul 26, 2015 · 1 comment
Closed

UITabBarControllerDelegate Doesn't work #42

aalzanki opened this issue Jul 26, 2015 · 1 comment

Comments

@aalzanki
Copy link

You can't delegate RAMAnimatedTabBarController.

@cdf1982
Copy link

cdf1982 commented Aug 11, 2015

+1, I used to call tabBarController(tabBarController: UITabBarController, didSelectViewController viewController: UIViewController) and it worked fine before, but since I adopted RAMAnimatedTabBarController this method isn't called anymore; I tried changing the type in the function name, but didn't work... any suggestions?

EDIT
I actually found a workaround for what I need: inside the function tapHandler(gesture: UIGestureRecognizer), under let currentIndex = gesture.view!.tag and above if selectedIndex != currentIndex { I added:

 if (self.delegate != nil) {
        self.delegate?.tabBarController!(self, didSelectViewController: self.selectedViewController!)
    }

If needed, the same code also works inside setSelectIndex(#from:Int,to:Int), just under selectedIndex = to

Now the delegate method works fine for me.

@0ber 0ber closed this as completed Dec 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants