Architecting iOS Apps

Architecting iOS Apps

1、MVC

2、VIPER

What is VIPER?

VIPER is an application of Clean Architecture to iOS apps. The word VIPER is a backronym for View, Interactor, Presenter, Entity, and Routing. Clean Architecture divides an app’s logical structure into distinct layers of responsibility. This makes it easier to isolate dependencies (e.g. your database) and to test the interactions at the boundaries between layers:

Architecting iOS Apps_第1张图片

Architecting iOS Apps_第2张图片

Main Parts of VIPER are:

  • View: displays what it is told to by the Presenter and relays user input back to the Presenter.
  • Interactor: contains the business logic as specified by a use case.
  • Presenter: contains view logic for preparing content for display (as received from the Interactor) and for reacting to user inputs (by requesting new data from the Interactor).
  • Entity: contains basic model objects used by the Interactor.
  • Routing: contains navigation logic for describing which screens are shown in which order.

Reference:

  • Architecting iOS Apps with VIPER
  • demo mutualmobile/Counter
  • 浅入浅出VIPER设计架构(1)

3、MVVM

你可能感兴趣的:(Architecting iOS Apps)