Skip to main content


Showing posts from 2018

Understanding MVP

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…

Test cases code coverage in Xcode

How to check what percentage of unit test cases cover your classes/framework/project:- After writing unit test cases, make sure your all test cases run successfully. To cross check this, Goto Product menu->Perform action-> Test without buildingGoto Edit scheme: Select Test and select the "Gather coverage data" option.To see the code coverage, perform step no 1 once again.Open the last tab(report navigator) on the left panel.Open the coverage tab(at the top panel)