Tinder就像泛iOS一样 [英] Tinder like pan iOS

查看:126
本文介绍了Tinder就像泛iOS一样的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于iOS中的Tinder应用程序,我假设他们在图像视图上使用了平移手势识别器。如何在用户开始移动的图像下方显示另一个图像?他们是否有另一个图像视图,在手势识别器完成后,动态设置图像视图手势识别器,最后在下面创建另一个图像视图?

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 move? Do they have another image view and after the gesture recognizer finishes, dynamically set the image view gesture recognizer, and finally create another image view underneath?

推荐答案

您可以使用自己的手势识别器创建自定义卡类,并使用方法didSwipeLeft / Right创建委托。代表将在刷卡时回拨并将下一张卡移到前面。对于代码重用,您可以为此卡创建通用管理器。
您可以在这里查看卡和经理的实施:
https://github.com / Yalantis / Koloda

You can create custom class of card with own gesture recognizer and create delegate with methods didSwipeLeft/Right. Delegate will get call back on swiping and move next card to the front. For code reusing you can create universal manager for this cards. You can look at the implementation of card and manager here: https://github.com/Yalantis/Koloda

这篇关于Tinder就像泛iOS一样的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆