O'Reilly logo

Instant Website Touch Integration by Alexander Dickson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

A custom gesture can go a long way (Advanced)

Nobody's perfect, and thus for our paint application, we need a way of clearing the canvas. We can invent our own gesture for this, as anything that can be described in code can become a gesture.

Getting ready

For our use case, we will use two fingers swiping up and away from each other over the canvas. This will look like tracing the outline of an upside down equilateral triangle. Have a look at the following photos of the before and after state of the gesture:

Getting ready

How to do it...

We have built upon the basic Finger Painter application with some modifications, so it won't try and draw while the user attempts ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required