Yalantis / Koloda

KolodaView is a class designed to simplify the implementation of Tinder like cards on iOS.
https://yalantis.com
MIT License
5.37k stars 805 forks source link

card is not swiping on button click #464

Open sahabe1 opened 3 years ago

sahabe1 commented 3 years ago

swipe left and swipe right not working on button click same issue is happening in demo code

timothyerwin commented 3 years ago

I am seeing the same issue

timothyerwin commented 3 years ago

This seems to be happening if you call .swipe() too quickly...but then it's unusable as the swipe must be delayed to a certain time limit....please fix it

timothyerwin commented 3 years ago

This is caused because isAnimating is true even after the card is already swiped thus blocking fast swipes

aliabbas90 commented 3 years ago

I am not facing this issue while I am dragging cards but while the button is tapped. After an investigation in the source code, I found that the increment method (in KolodaAnimationSemaphore) is called twice when we call the swipe method (for eg. kolodaView.swipe(.right)). I was able to fix the issue by removing the animationSemaphore.increment() from public func swipe(_ direction: SwipeResultDirection, force: Bool = false) in KolodaView.swift file. It will be incremented in the swipedAction from KolodaView.swift, so removing this line will avoid the double incrementation.

harshvirsinh commented 2 years ago

not wor

I am not facing this issue while I am dragging cards but while the button is tapped. After an investigation in the source code, I found that the increment method (in KolodaAnimationSemaphore) is called twice when we call the swipe method (for eg. kolodaView.swipe(.right)). I was able to fix the issue by removing the animationSemaphore.increment() from public func swipe(_ direction: SwipeResultDirection, force: Bool = false) in KolodaView.swift file. It will be incremented in the swipedAction from KolodaView.swift, so removing this line will avoid the double incrementation.

not working bro..