mac-gallagher / Shuffle

🔥 A multi-directional card swiping library inspired by Tinder
MIT License
897 stars 138 forks source link

Make SwipeCard reusable? #123

Open disczteam opened 3 years ago

disczteam commented 3 years ago

Feels wasteful to have to recreate the views every time in cardForIndexAt. It would be super awesome to see card view reuse if possible!!

Loving everything else!

mac-gallagher commented 3 years ago

Thanks for the suggestion @disczteam. Are you seeing any performance issues? This would be a nice feature, however I do not really see the need for it.

For UITableView, we need cell reuse to maintain 60fps while scrolling. In the case of this library, we only ever have 2 cards on screen, so it seems like a wasted effort since we are at 60 fps most times anyways. The one potential spot for improvement is right after a card is swiped; there is currently a small delay at this point and card reuse could possibly reduce the delay