From the course: iOS Development: Architecture

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

The main run loop

The main run loop

From the course: iOS Development: Architecture

Start my 1-month free trial

The main run loop

- [Instructor] After the app finishes the startup sequence, its UI is displayed and it starts responding to user and system messages. The mechanism used for processing user events is implemented in the main run loop. The main run loop gets created by the UI application object doing the app initialization. Events like touches and swipe gestures are added to a five-o-que and dispatched to the main run loop one after the other. The main run loop for was the advanced to the UI application object, which intern dispatches the events to the corresponding objects. Now let's see a practical demonstration of the user event processing. I created an IOS project called Main Run Loop that's based on the single view app template. You can open it from exercise files chapter two or 205 begin. To intercept system events we'll need a custom UI application sub-class. Thus I'm going to create a new file. It should be a Cocoa Touch class. Which is a subclass of UI application. I call it custom application.…

Contents