Understanding App Structure

Although there are many possible ways to structure an app, all apps share some common elements. They’re shown in Figure 4.6.

Here’s how each object in the structure handles messages:

bullet_2c.tif iOS sends app-level messages to the Application Delegate object. These messages arrive as the app is launched and loaded, when it’s moved to the background after the user presses the Home button, or when some other app-level event happens, such as a low memory condition.

bullet_2c.tif The App Delegate includes a window object. In iOS apps, the window object is just a placeholder for other content. It doesn’t have a frame around it, it can’t be moved, and it doesn’t have open/close/minimize/maximize buttons. It has a small repertoire of messages, but they’re not often used.

9781118462133-fg0406.eps

4.6 An outline structure of an iOS app.

bullet_2c.tif iOS sends screen control and animation messages to the View Controller object. The View Controller loads and unloads screen content as the app runs, with optional animations. It can also respond to user touch events from the screen, and it manages screen rotations.

View objects are ...

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.