Model-View-Controller

Model-View-Controller, or MVC, is a design pattern used in iOS development. In MVC, every object is either a model object, a view object, or a controller object.

  • View objects are visible to the user. Examples of view objects are buttons, text fields, and sliders. View objects make up an application’s user interface. In Quiz, the labels showing the question and answer and the buttons beneath them are view objects.

  • Model objects hold data and know nothing about the user interface. In Quiz, the model objects will be two ordered lists of strings: one for questions and another for answers.

    Usually, the model objects are modeling real things from the world of the user. For example, when you write an app for ...

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.