Tinder like pan iOS

后端 未结 5 844
刺人心
刺人心 2021-01-22 23:24

For the Tinder app in iOS, I assume they are using a pan gesture recognizer on the image view. How is it that another image is shown underneath the image the user has started to

5条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-22 23:49

    https://github.com/cwRichardKim/TinderSimpleSwipeCards

    Take a look at this. It kind of breaks down what goes into making swipe cards. The answer to your question is that there is an array of cards, with only 2 or 3 on the view controller at any one time. When you swipe one away, it loads the next one underneath the others. As for how they set the gesture recognizer, the cards might be a custom class where all the gesture stuff is already implemented, or they might reimplement it every time, but yes they do have to add the gesture recognizer each time.

提交回复
热议问题