100 Days of SwiftUI
2026-08-08
Project 17, part 1
Flashzilla: a project for learning about gestures
How to use gestures in SwiftUI
- More than
onTapGesture() onLongPressGesture()can be adjusted to trigger after a certain amount of secondsonPressingChanged:keeps track of the progress of the trigger
- watch out for clashing gestures — child gestures have priority unless you specify otherwise
- you can also have gesture sequences, e.g.
let combined = pressGesture.sequenced(before: dragGesture)


Disabling user interactivity with allowsHitTesting()
- if a View has
.allowsHitTesting(false)it gets ignored on tap - you can do a lot of confusing things!