Scalable Design : Your Next Unicorn iOS App

Rahul Goel
3 min readJul 28, 2021

--

This article intends to give the testable start-off point for ios-devs trying to ship their very first app to App Store.

What : List of latest news to be pulled from news-api, parsed and shown as a list on home screen of the iOS app. App Code should be written in a way, making it mostly testable by writing unit test with XCTest framework.

How : I have used MVVM for structuring the code paired with unit tests written via XCTest.

High Level Design Code:

“HLD”
  1. HomeViewController : Class consisting of UI part of the app.
“HomeViewController”

2. HomeViewModel: Class to provide all the data HomeViewContoller or view from models.

“HomeViewModel”

3. HomeAPIManager: Class to fetch news from news-api end points

“HomeAPIManager”

4. News: Model for the News item from news-api response.

“News”

5. NewServices: Protocol to fetch news from news-api end points.

“NewsService”

6. HomeViewModelDelegate: Delegate to send across info from ViewModel to HomeVC.

HomeViewModelDelegate

Test High Level Design :

  1. MockHomeAPIManager:
“MockHomeAPIManager”
  1. MockHomeViewDelegateImplementation:
“MockHomeViewDelegateImplementation”
  1. HomeViewDeleegateTests:
“HomeViewDeleegateTests”

Here is the GitHub link for the repo.

Follow me Rahul Goel for more updates.

Follow me Rahul Goel for regular updates.

--

--

Rahul Goel

Computer Science Enthusiast | 11+ Year of Software Evolution | @Sharechat, Groupon, Paytm, Myntra https://www.linkedin.com/in/therahulgoel/