DEV Community

David Goyes
David Goyes

Posted on

SwiftUI #7: Reconocer gestos con GestureRecognizer

Detectar arrastre en la pantalla con DragGesture

.gesture(
  DragGesture(minimumDistance: 20)
    .onEnded({ _ in
      memory = 0.0
    })
)
Enter fullscreen mode Exit fullscreen mode

Detectar doble toque en la pantalla con TapGesture

TapGesture(count: 2)
  .onEnded { _ in
    memory = 0.0
  }
Enter fullscreen mode Exit fullscreen mode

Top comments (0)