Understanding User Interaction

Typically, a user taps on the screen to make something happen in an app, and the app responds by updating the content of the screen. It may also perform other tasks, such as downloading data from the Internet, getting the current device location, and so on.

Interaction is usually manual, but it can also be automated with timers, delayed messages, and other scheduled events. In this chapter, we’ll look at manual interaction—capturing and processing events generated by a user.

Introducing actions, outlets, and responder events

iOS includes three systems for dealing with manual interaction:

bullet_2c.tif Actions send messages to objects in your code. Action messages can be created by onscreen controls and by external events.

bullet_2c.tif Outlets control the properties of onscreen objects. You can use properties to change the appearance and content of objects on the screen as your app runs.

bullet_2c.tif The responder system sends messages to objects that volunteer to receive them.

Let’s look at what this means in practice.

Working with actions, outlets, and responder events

In an app, you typically design a UI with a number of controls—buttons, sliders, text boxes, and so on—and then connect

Get iOS App Development Portable Genius now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.