Model-View-Controller
You may hear iOS programmers mention the Model-View-Controller pattern. What this means is every object you create is exactly one of the following: a model object, a view object, or a controller object.
View objects are visible to the user. In Quiz, the buttons, labels, and window are all view objects. Views are usually standard UIView subclasses (UIButton, UISlider), but you will sometimes write custom view classes. These typically have names like DangerMeterView or IncomeGraphView.
Model objects hold data and know nothing about the user interface. In this application, the model objects will be two arrays of strings: the questions array and the answers array. Figure 1.11 displays the object diagram of the Quiz application’s ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access