Search code examples
swiftuigesturedraggesture

Detect single/multi-finger gesture Swiftui


How to detect number of finger interaction with Gesture in SwiftUI Gesture. With UIKit we can find number of find it from

        let numberOfTouches = panGestureRecognizer.numberOfTouches

Any thought?


Solution

  • I am able to find my solution using UIKit UIView. Actually made container view(UIVIewRepresentable) which implements the PanGesture. I have used this view to to hold SwiftUI view. I can easily find and able to handle Panning behaviour.