Understanding the Model View Controller architecture
Apple built iOS apps to use what is known as 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 better understand:
Let's discuss each camp:
Model
The Model camp is responsible for an app's data and business logic. The Model's only job is to handle representations of data, storage of data, and the operations performed on the data.
View
The View camp is responsible for all the things that you see on the screen. The View handles presenting and formatting the data that results from the user's interactions.
Controller
The Controller camp is the liaison or coordinator between the other two camps. The Controller handles a lot of setup and connections to the View. The Controller also interprets user interactions. Since the Controller is between both...