Google News
logo
Swift - Interview Questions
Explain MVC structure.
MVC stands for the model view controller. MVC is a powerful software architecture pattern for using developing apps.
 
MVC builds on top of the Object-Oriented Programming concepts. It structures the flow of data and interaction in our app. Model-View-Controller is an important fundamental concept to be understood in iOS development. Many iOS frameworks, like UIKit, Cocoa Touch, use the MVC pattern for messaging and structured data flow.
 
Model-View-Controller is used to pass the data from one part of our app to another.
 
Its a design pattern used to assign objects in an application in any one of the three roles :
 
Model : Model is a wrapper of data. Model is a representation of our app data and it holds the information to a specific user like birthdate, username, etc. The model manages the application state. This also includes writing and reading data. The Model encapsulates an individual set of data and applies some logic to manipulate that data.

View : View is a representation of a UI(User Interface). A View is an object that the visible to the user and it interacts with a user interface (UI).

Controller : Controller is an intermediary between the View and the Model. The controller controls all the logic that goes between the Model and the View. Its inter-communicates messages between the Model and the View, and vice versa.
Advertisement