JoniVR / VerticalCardSwiper

A marriage between the Shazam Discover UI and Tinder, built with UICollectionView in Swift.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Feature Request] Ability to set custom Swipe Percentage Margin

AmandeepTMSFalcon opened this issue · comments

Now when I swipe 20-30% then card goes to left and right. But I want ratio of 5%. When I just swipe 5% then card should be goes to left and right.
Where I need to change ?????

Currently this is not implemented in the API yet, but I might add this in a future version.

If you want to modify the behaviour in your own project, you need to change the swipePercentageMargin variable found here:

let swipePercentageMargin = self.bounds.width * 0.4

Feel free to implement it yourself in a PR if you don't want to wait for me to do it.

I changed this also but no getting any effect on the swipe margin percentage.
I update this to
let swipePercentageMargin = self.bounds.width * 0.1

And if I commented endedPanAnimation() function then code is also working.
I don't know where I am doing something wrong.
Please correct me also.

And if I commented endedPanAnimation() function then code is also working.

This is weird because when I comment that line out it does break the code:

ezgif com-video-to-gif

Maybe you're still testing the old build on accident? Try cleaning your build folder perhaps?

And if I commented endedPanAnimation() function then code is also working.

This is weird because when I comment that line out it does break the code:

ezgif com-video-to-gif

Maybe you're still testing the old build on accident? Try cleaning your build folder perhaps?

Thanks JoniVR. The problem was with cache.

Hello JoniVR,

I am unable to reload the number of cards and cellForItemAt.
I am doing code like:
let mainCard:VerticalCardSwiper!
Then
mainCard.reloadData()

This is not working. Please help me to sort out this.