12 Touch Events and UIResponder

For the next three chapters, you are going to step away from Homepwner and build a new application named TouchTracker to learn more about touch events and gestures, as well as debugging applications.

In this chapter, you will create a view that lets the user draw lines by dragging across the view (Figure 12.1). Using multi-touch, the user will be able to draw more than one line at a time.

Figure 12.1  A drawing program

A drawing program

Touch Events

As a subclass of UIResponder, a UIView can override four methods to handle the four distinct touch events:

  • a finger or fingers touches the screen ...

Get iOS Programming: The Big Nerd Ranch Guide now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.