This app uses the MVP (Model View Presenter) Architechture pattern. (each View Controller is a View)
- Data module contains Repositories and Models.
- Presentation module contains Views and Presenters. Each sub-module in Presentation represents a simple user story or feature like Login, Shares. This pattern is known as package by feature.
- Base module contains reusable functionalities for MVP Views and common UIViewController functionalities and
- Extension module contains extensions to first-class Swift classes and iOS Framework classes.
View
- delegates user interaction events to thePresenter
and displays data passed by thePresenter
* AllUIViewController
,UIView
,UITableViewCell
subclasses belong to theView
layer * Usually the view is passive / dumb - it shouldn't contain any complex logic.Presenter
- contains the presentation logic and tells theView
what to present * Usually we have onePresenter
per scene (view controller) * It doesn't reference the concrete type of theView
, but rather it references theView
protocol that is implemented usually by aUIViewController
subclass * It should be a plainSwift
class and not reference anyiOS
framework classes - this makes it easier to reuse it maybe in anmacOS
application