Member-only story
A UIGestureRecognizer Tutorial
Drag and drop
The interaction between user and App is extremely important. This extends from the look and feel of the application right to the touch gestures that make the user’s interactions delightful.
In order to make the application respond to these gestures you will need UIGestureRecognizer, and this tutorial should help you out in doing so.
Difficulty: Beginner | Easy | Normal | Challenging
Prerequisites:
- You can use gestures in a Single View Application, or use Gestures in the Playground to set up this project
Terminology
UIGestureRecogniser: The base class for gesture recognisers, which include tap and pinch recognisers
The end result
This isn’t going to be pretty. You’re going to see some squares moving around an App according to whether the user drags, drops, pinches or rotates. Thomas Was Alone doesn’t have anything on this stuff!
The setup
The setup for this has been done directly in Playgrounds. In practice I’ve already written a tutorial for this, but to get this working I used import PlaygroundSupport
at the top of the playground and set the live view with…