eggswift / ESTabBarController

:octocat: ESTabBarController is a Swift model for customize UI, badge and adding animation to tabbar items. Support lottie!
MIT License
5.17k stars 578 forks source link

The deselectAnimation method not work when press default selected index tabBar on first time #221

Closed joshua24322 closed 1 year ago

joshua24322 commented 4 years ago

I have been setup iconColor = .white and highlightIconColor = .systemBlue in my BasicContentView.

When app launch, press the Home tabBar while it tabBar is default selectedIndex , the override func selectAnimation(animated: Bool, completion: (() -> ())?) be call.

Then press the next Find tabBart or another tabBar, the override func deselectAnimation(animated: Bool, completion: (() -> ())?) won't work for Home tabBar , resulting in the Home tabBar still highlight status.

This issue can be recover by re-press the Home tabBar, the override func deselectAnimation(animated: Bool, completion: (() -> ())?) start work for it.

is there any idea or experience for this symptom ?

highlight issue
joshua24322 commented 4 years ago

My temporary solution is setting the selectedIndex = 1 (no equal to Home tabBar) and selectedViewController = self.viewControllers?.first (the viewController equal to Home tabBar), implement on subclass viewDidLoad of ESTabBarController.

Is there any better workaround for it?

inoue0124 commented 4 years ago

I am also facing this issue.