a starter iOS project using VIP ( View Interactor Presenter ) Architecture
download this template from clean-swift.com, after download open template directory in terminalan type make install_templates
for instal template, to produce new scene
: New File
-> iOS
-> Clean Swift
-> Scene
-> Type your scene name
-
Fabric
-
Crashlytics
-
Alamofire ( networking )
-
AlamofireImage ( request image from server )
-
ModelMapper ( mapping model )
-
PKHUD ( Loading View )
VIP is a set of Xcode Templates for produce Clean Architecture
component.
ViewController
receive user interaction, create request object and send it toInteractor
.- The interactor doing some work with
request object
, consntruct response object, and send it to presenter. - Presenter formating data from
response object
, and constructview model object
and send it toViewController
. ViewController
display result inViewModel
to user.
- ViewController containts display logic
- To make a new
scene
:New File
->iOS
->Clean Swift
->Scene
->Input Scene Name
- Implement
UIViewController
orBase__ViewController
- Implement
UITableViewController
,UICollectionViewController
, orUIWebViewController
if needed - Implement
BaseFormViewController
forscene
Form Scene
- Use
xib
, don't usestoryboard
.
Interactor
containtBussiness Logic
- Use
worker
if needed - Wait request for
ViewController
and sendresponse object to presenter
- Contain
ViewLogic
- reformat data from
interactor
and send toViewController
.
- Use
xib
orby code
- Don't put
business logic
here
- Representation from object with its property
- Use
ModelMapper
- Navigate to next
scene
- Send data to other
ViewController
[Optional] Core
- Assets.xcassets
- LaunchScreen.storyboard
- AppDelegate.swift
Base
Models
Scenes
- YourSceneName
Services
Worker
Nama Group | Deskripsi |
---|---|
Core | Contain core xcode project like Assets.xcassets , LaunchScreen.storyboard , and AppDelegate.swift |
Base | Base class that used to minimalize code |
Models | Contain data structure that used for data management |
Scenes | Contain VIP Components that construct Scene |
Services | Global Helper that unrelated with business logic |
Worker | Global Helper specific for business logic |