Understanding the Model View Controller architecture

Apple built iOS apps to use what is known as the Model View Controller (MVC), which is an architectural pattern that describes a way to structure the code in your app. In layman's terms, this just means breaking up our app into three distinct camps: Model, View, and Controller.

Here is a diagram of MVC to help you understand it:

Let's discuss each camp:

In summary, the Controller takes user interactions and either responds back to the View or passes it onto the Model. When the Model completes a task, it passes it back to the Controller, and then the Controller talks with the View.