Gestures

Overview

Subjects

Using Gestures

Hacking with Swift / 100 Days / Day-86 - How to use gestures in SwiftUI

Tags: #MagnificationGesture #onChanged #RotationGesture #rotationEffect

Magnification

Rotation

Tapping

Dragging

Hacking with Swift / 100 Days / Day-88 - Moving views with DragGesture and offset()

Tags: #offset #DragGesture #CGSize #RotationEffect #removal #swipe

Hacking with Swift / 100 Days / Day-89 - Coloring views as we swipe

Tags: #Swipe #Drag #DifferentiateWithoutColor #xmark #checkmark

For colorblinds you may should use graphics instead of colors. Differentiate Without Color will help on this purpose.

High Priority Gesture

As default, SwiftUI gives priority to child gesture. To overcome that we should define the parent Gesture as a highpriority.

Simultaneous Gesture

Trigers all the gestures at the same time.

Sequential Gestures

First needs to be long pressed, an than it activates the second gesture.

Solutions / Examples

Dynamic Emoji

https://twitter.com/philipcdavis/status/1580211607627390976?s=12&t=PW_LE1rEl7C8W6gcTx0V3g

Sources

Videos

Articles / Documents

See also

Last updated

Was this helpful?