A large iOS application needs to be architected like a house – designed, structured, modularised.

To architect an app, first we need to categorise the modules that can be reused, which implementations can be replaced / updated later. Usually they are:

  1. Networking module: what will be downloaded from internet. And how to parse them into data models.
  2. Data models: design the objects.
  3. Persistence: what will be stored into files, coredata or nsuserdefaults?
  4. UI: can use storyboard.
  5. View-Models: mvvm style – instead of using lots of arrays to store data in ur viewcontrolllers – use view model – all the data & states should be kept there! It can be passed around as a whole, or notify/display viewcontrollers when it changes.

There are now 2 popular approaches for iOS Architecture:

I. MVVM

II. VIPER

References:

  1. OBJC.IO ARCHITECTURE
  2. http://khanlou.com/2014/03/model-view-whatever/
  3. Apple Architecture Guideline
  4. Apple WWDC Talk
Advertisements