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:
- 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, data storage, and the operations performed on data.
- View: The View camp is responsible for all the things that you see on the screen. The View handles presenting and formatting data that results from the user's interactions.
- Controller: The Controller camp is the liaison or coordinator between the other two camps. The...