Swift - Tinder effect

前端 未结 4 1838
醉酒成梦
醉酒成梦 2020-12-29 00:02

How can I achieve Tinder effect in Swift?

I mean, I have an image and want to accept if I swipe to right and reject if I swipe to left.

I can do it with the

4条回答
  •  情书的邮戳
    2020-12-29 00:13

    It's better to use UIPanGestureRecognizer here and manage its states, as you've already figured out. For managing cards it would be good solution to create class-manager that will handle interactions between cards(moving background cards on swiping the front). You can look at the implementation of card and manager here, there are implementation of dragging, moving background cards and revert animations. https://github.com/Yalantis/Koloda

提交回复
热议问题