- User Interface where user interacts or see or input information
- Examples: UITableView, UICollectionView, UIView, UIButton, etc.
- Logic layer: get data from database and provide logical functions
- Examples: map data to another type, provide bonus when user finishes a task, etc.
- View asks Presenter for information/data. Presenter asks Interactor to return data
- Presenter communicates with Router to open new screens, but Router have the logic of transition
-
Navigation logics
-
Examples:
pushViewController()
,addSubView()
, etc.
- Make your codes scalable, easier to test each layer
- Make your ViewController lightweight
- Build the app based on use cases or behaviors
- Router keeps a weak reference of the View and the Presenter
- Presener hold strong refernces of Router and Interactor
- Interactor keeps a weak reference of Presenter
- View keeps a strong reference of Presenter