Posts

Showing posts from November, 2018

Understanding MVP

Image
We all are using MVC in the beginning because it is easy, but MVP architecture is not that difficult to understand and implement in iOS project. Currently, I am using the MVP architecture in my latest project and I come to know many advantages of it.

To begin with, the most preponderant advantage of using MVC is that it is scalable. The second significant advantage which is worth mentioning is that if you have different flavours of your application where business logic (presenter) is same, then MVC is the right choice.

A good example here is:-

MVP folder structure consist of model, view, protocols, presenter, xib, service classes.




Model class consist of all the properties which hold the dataView class consist of all the UI elements which are visible to user. Separate xib for each viewProtocol class consist of methods which need to implement by view class and presenter classPresenter class consist of business logicService class consist of api interaction methods
Flow: Assign the custom vi…