Chapter 14. Monitoring events and actions

 

This chapter covers

  • The SDK’s event modeling
  • How events and actions differ
  • Creating simple event- and action-driven apps

In the previous chapter you learned how to create the basic view controllers that fulfill the controller role of an MVC architectural model. You’re now ready to start accepting user input, since you can now send users off to the correct object. Users can interact with your program in two ways: by using the low-level event model or by using event-driven actions. In this chapter, you’ll learn the difference between the two types of interactions. Then we’ll look at notifications, a third way that your program can learn about user actions.

Of these three models, it’s the events that provide the lowest-level detail (and which ultimately underlie everything else), and so we’ll begin with events.

14.1. An introduction to events

We briefly touched on the basics of event management in chapter 10, but as we said at the time, we wanted to put off a complete discussion until we could cover them in depth; we’re now ready to tackle that job.

Part 1 of this book, dealing with web design, outlined how events tend to work on the iPhone. The fundamental unit of user input is the touch: a user puts his finger on the screen. This could be built into a multi-touch or a gesture, but the touch remains the building block on which everything else is constructed. It’s thus the basic unit that we’re going to be examining in this chapter.

14.2. A touching example: the event reporter

14.3. Other event functionality

14.4. An introduction to actions

14.5. Adding a button to an application

14.6. Other action functionality

14.7. Introducing notifications

14.8. Summary

sitemap