A UIGestureRecognizer Tutorial

Image for post
Image for post
Photo by Eugene Chystiakov on Unsplash

Prerequisites:

Terminology

The end result

The setup

The theory

A pan gesture

Image for post
Image for post
Click for Gist
Image for post
Image for post
Click for Gist

Pinch

Image for post
Image for post
Image for post
Image for post

A tap gesture

Image for post
Image for post
Image for post
Image for post

A long-press gesture

Image for post
Image for post
Image for post
Image for post

A rotation gesture

Image for post
Image for post
Image for post
Image for post

A swipe

Image for post
Image for post
Image for post
Image for post

Multiple views per gesture

Did you make sure the user can interact?

Conclusion:

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store