ios 在对象处理的同时识别手势
与 UIKit 对象交互时是否可以同时识别手势和触摸。例如,当用户滚动滑块或选择器视图时,我是否也可以处理滑动手势?
Is it possible to recognize gestures and touches simultaneously when interacting with a UIKit object. For example, when a user is scrolling through a slider or pickerview, could I also be handling a swipe gesture?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您将视图控制器设置为手势的委托,您可以实现:
我不确定您是否也尝试让视图单独处理触摸事件,但如果您是,我建议子类化 UIGestureRecognizer 和在那里处理触摸事件。
If you set your view controller to be the delegate of your gestures, you can implement:
I'm not sure if you're also trying to have the view handle touch events separately, but if you are, I'd recommend subclassing UIGestureRecognizer and handle touch events there.
使用 NSThread 或 NSTimer 创建一个新线程,您可以在其中创建另一个与应用程序的主线程并行运行的进程
Use NSThread or NSTimer to create a new thread where you can create another process which will run parallel to main thread of the application