简体   繁体   English

检测单/多指手势 Swiftui

[英]Detect single/multi-finger gesture Swiftui

How to detect number of finger interaction with Gesture in SwiftUI Gesture .如何在 SwiftUI Gesture中检测手指与 Gesture 的交互次数。 With UIKit we can find number of find it from使用 UIKit 我们可以找到从

        let numberOfTouches = panGestureRecognizer.numberOfTouches

Any thought?任何想法?

I am able to find my solution using UIKit UIView.我可以使用 UIKit UIView 找到我的解决方案。 Actually made container view which implements the PanGesture.实际上制作了实现 PanGesture 的容器视图。 I have used this view to to hold SwiftUI view.我用这个视图来保存 SwiftUI 视图。 I can easily find and able to handle Panning behaviour.我可以轻松找到并能够处理平移行为。

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

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