Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using Shuffle in UITableView/UICollectionView #56

Closed
andre991 opened this issue May 9, 2020 · 4 comments · Fixed by #61
Closed

Using Shuffle in UITableView/UICollectionView #56

andre991 opened this issue May 9, 2020 · 4 comments · Fixed by #61
Labels
bug Something isn't working

Comments

@andre991
Copy link

andre991 commented May 9, 2020

Describe the bug
TableView and CollectionView don't scroll vertically if the shuffle is in any cell.

To Reproduce
Steps to reproduce the behavior:
Add SwipeCardStack inside TableViewCell/CollectionViewCell and scroll tableView vertically.

Expected behavior
If I chose to move horizontally, Shuffle don't be able to scroll vertically.

@andre991 andre991 added the bug Something isn't working label May 9, 2020
@mac-gallagher
Copy link
Owner

Hey @andre991! Thanks for reporting this issue, I will work on publishing a fix. In the meantime, you can try the following: for each SwipeCard, set card.panGestureRecognizer.delegate = yourViewController and conform your view controller to the UIGestureRecognizerDelegate protocol. You can write

func gestureRecognizerShouldBegin(_ gestureRecognizer: UIGestureRecognizer) -> Bool {
    guard let panGestureRecognizer = gestureRecognizer as? UIPanGestureRecognizer else { return true }
    let velocity = panGestureRecognizer.velocity(in: view)
    return abs(velocity.x) > abs(velocity.y) // return true only if pan gesture is more horizontal than vertical
  }

Let me know if that solves your issue for now. I will let you know once the actual fix is out!

@andre991
Copy link
Author

Hi @mac-gallagher, thanks for this solution!!! Worked perfectly!

This framework is awesome!!

Congratulations! 👏🏻👏🏻👏🏻👏🏻
Have a nice day.

#StayHome

@mac-gallagher
Copy link
Owner

Hey @andre991 - added support for this in version 0.2.2.

Cheers!
Mac

@mac-gallagher
Copy link
Owner

FYI @andre991, updated the solution a bit here #69 . The previous implementation with delegates was kind of awkward

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants