Is it possible to create a custom tabBarController
class in swift to animate programmatic and interactive transitions between tabs?
You can try this for transition animation on tabbar selecetion
func tabBarController(_ tabBarController: UITabBarController, shouldSelect viewController: UIViewController) -> Bool {
guard let fromView = selectedViewController?.view, let toView = viewController.view else {
return false
}
UIView.transition(from: fromView, to: toView, duration: 0.3, options: [.transitionCrossDissolve], completion: nil)
return true }
for reference use this link
How to animate Tab bar tab switch with a CrossDissolve slide transition?
I just figured this out, and posted an answer on another thread (link below). It adds a method:
tabBarController.setSelectedWithIndex(1)
to get this done with an animation.
I hope it works for you!
Answer: https://stackoverflow.com/a/57116930/1993937
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With