GithubHelp home page GithubHelp logo

Comments (4)

igork-ramotion avatar igork-ramotion commented on May 19, 2024

@alouanemed Hey, it seems that it already should work as you expect. Please take a look at source code:

      if selectedIndex != currentIndex {
            let previousItem = items.at(selectedIndex)
            let previousContainer: UIView? = previousItem?.iconView?.icon.superview
            previousContainer?.backgroundColor = items[selectedIndex].bgDefaultColor
            previousItem?.deselectAnimation()

            let currentItem: RAMAnimatedTabBarItem = items[currentIndex]
            currentItem.playAnimation()
            let currentContainer: UIView? = currentItem.iconView?.icon.superview
            currentContainer?.backgroundColor = items[currentIndex].bgSelectedColor

            selectedIndex = index
        } else {
            if let navVC = viewControllers?[selectedIndex] as? UINavigationController {
                navVC.popToRootViewController(animated: true)
            }
        }

If user select on same item second time and current view controller is UINavigationController it will pop to root view controller. Please let me know if you have any problem with this logic

from animated-tab-bar.

alouanemed avatar alouanemed commented on May 19, 2024

although I am using the latest version in my project, nothing happens when I tap multiple times on an item. what do you think? How can I debug this?

Thanks.

from animated-tab-bar.

igork-ramotion avatar igork-ramotion commented on May 19, 2024

Please take a look at double-tap-example branch, I've add example how it works.
Each time you tap on the screen next view controller will be pushed, and then if you press selected tab bar item it will pop to root view controller.

from animated-tab-bar.

renchris avatar renchris commented on May 19, 2024

For the else statement when you say "If user select on same item second time and current view controller is UINavigationController it will pop to root view controller", how do we access that for a custom animation class?

Also, I tried to add print statements to see when the else statement runs but it doesn't run when I tap an already selected tab bar item. Why is that?

from animated-tab-bar.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.