Model-View-Controller

Before you begin your application, let’s discuss a key concept in application architecture: Model-View-Controller, or MVC. MVC is a design pattern used in iOS development. In MVC, every instance belongs to either the model layer, the view layer, or the controller layer. (Layer here simply refers to one or more objects that together fulfill a role.)

  • The model layer holds data and knows nothing about the user interface. In Quiz, the model will consist of two ordered lists of strings: one for questions and another for answers.

    Usually, instances in the model layer represent real things in the world of the user. For example, when you write an app for an insurance company, your model will almost certainly contain ...

Get iOS Programming: The Big Nerd Ranch Guide 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.