Comments (4)
@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.
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.
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.
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)
- Setting image and title via nib not storyboard HOT 1
- Animates two items at the same time HOT 1
- Icons become 30x30 if you make setViewControllers second/third time HOT 1
- How to prohibit pictures from rendering HOT 1
- RTL not supported? HOT 1
- Seting animation programmatically does not work HOT 2
- Animation does not work
- Hiding tabbar issue HOT 1
- TabBarItem text color doesn't obey the tint color when selected HOT 1
- Demo is not working HOT 2
- First tabbarItem Text tintColor is wrong HOT 2
- selectedImage property makes me confused HOT 1
- Followed everything but I didn't get anythings HOT 5
- The dividing line disappears HOT 2
- How to integrate with lottie?
- iOS 16 crashes HOT 3
- bar appering over iOS bottom line
- Increase TabBar Height
- Do it support git image
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from animated-tab-bar.