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

Swiping your way to success (Intermediate)

The most famous touch interaction is the swipe. It's simple, intuitive and luckily, it isn't a headache to implement. Swiping can perform all sorts of tasks, most commonly, to change between views (swiping through items in a set, such as images) or switching contexts, such as dragging down an auxiliary view for your application (such as dragging down the notifications bar in iOS).

Getting ready

Swiping is relatively straightforward to achieve by using the events we learned about in the previous recipe. Basically, we shift the desired element by the amount of pixels from the original touch, which acts as the origin. In our example, we will add the ability to our paint application to change the color of the ...

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