简体   繁体   English

如何在Xcode中根据手指的位置进行左右手势

[英]How to make a left/right segue that follows the position of the finger in Xcode

So im not new to xCode, been coding for awhile, but recently I've been looking into custom segues. 因此,对于xCode而言,我不是陌生人,已经编码了一段时间,但是最近我一直在研究自定义序列。 So i was able to easily create a left/right sliding segue, but i was wondering how to get it to track finger sliding, similar to how whatsapp's segue works. 因此,我能够轻松地创建左右滑动序列,但是我想知道如何使其跟踪手指滑动,类似于whatsapp的序列如何工作。 so like the more i slide my finger to the left/ right, the more of the destination view controller is shown, and less of the source view controller. 因此,就像我将手指向左/向右滑动越多,显示的目标视图控制器就越多,而源视图控制器就越少。 (objective c) (swift example will be helpful too). (目标c)(举个例子也很有帮助)。 Appreciate the help. 感谢帮助。

This approach is called sidebar navigation. 这种方法称为边栏导航。 A lot of examples are available online. 在线提供了很多示例。 At least, you can refer to: http://www.appcoda.com/ios-programming-sidebar-navigation-menu/ or http://www.raywenderlich.com/32054/how-to-create-a-slide-out-navigation-like-facebook-and-path 至少,您可以参考: http : //www.appcoda.com/ios-programming-sidebar-navigation-menu/http://www.raywenderlich.com/32054/how-to-create-a-slide -out导航样Facebook的和路径

Source code snippet can be taken from: https://github.com/jdehlin/Xamarin-Sidebar 可以从以下网址获取源代码片段: https//github.com/jdehlin/Xamarin-Sidebar

Another unusual approach here: https://github.com/twotoasters/TWTSideMenuViewController 另一个不寻常的方法在这里: https : //github.com/twotoasters/TWTSideMenuViewController

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM