PaoloCuscela / Cards

Awesome iOS 11 appstore cards in swift 5.
MIT License
4.2k stars 274 forks source link

A bug when using Cards in UIScrollView #24

Closed big-ice closed 6 years ago

big-ice commented 6 years ago

Thanks for your great work👏!

I met an issue when I use Cards in UIScrollView. I put some cards on scrollview, and when I slide the finder with the finger holding on the card, the card call the "pushBackAnimated" method and will not call the "cardTapped" method.

PaoloCuscela commented 6 years ago

Thanks for the tip ! I' ll surely fix that in the next update :D

Edit. Sorry I misunderstood your problem. This is intended because 'pushBackAnimated' only perform the push back animation. 'cardTapped' is called when the touch ends and presents the detail view.

ftitreefly commented 6 years ago

Hi, PaloCusela, I met this issue too when I use Cards in UIScrollView. I put some cards on scrollview, and when I press the card, and slide down or up at the same time, the card will not call 'present()' and 'resetAnimated' mothed.

PaoloCuscela commented 6 years ago

This happens because of the gesture recogniser that calls the touchesCancelled method. Imo presenting the card in that case is inappropriate. Anyway you can solve this by ovveriding ''touchesCancelled()'' method in UIGestureRecogniser extension in "Card.swift" file.