Repository with swift templates for more comfortable development.
To use templates from Xcode, place *.xctemplate
folders in ~/Library/Developer/Xcode/Templates/
.
Templates contained in the repository:
The module contains the main parts of VIPER module. For injection of dependencies, a configurator and constructor injection are used.
The template creates several files that start with <ModuleName>
:
-
View
. It contains:protocol IViewDelegate: AnyObject
protocol IView: UIView
. Main view conforms to this protocol- main view class. It contains a weak reference to its delegate
-
ViewController
. It contains:protocol IViewControllerDelegate: AnyObject
protocol ICollectionsViewController: UIViewController
. ViewController conforms to this protocol- view controller. It owns
mainView: IView
andpresenter: IViewControllerDelegate
-
Presenter
. It contains:typealias IPresenter = IViewDelegate & IViewControllerDelegate & IInteractorDelegate
.Presenter conforms to this protocol.- Presenter class. It owns
router: IRouter
andinteractor: IInteractor
and contains weak references to view and viewController
-
Router
. It contains:- router class that conforms to common
protocol IRouter
. It contains weak reference to navigationController
- router class that conforms to common
-
Interactor
. It contains:protocol IInteractorDelegate: AnyObject
protocol IInteractor
. Interactor conforms to this protocol- Interactor class. It contains weak reference to presenter
-
Configurator
. It contains:protocol IConfigurator
. Configurator conforms to this protocol- Configurator class. It owns
view: IView
,realViewController: IViewController
,presenter: IPresenter
,router: IRouter
andinteractor: IInteractor
. The router is an external dependence that is injected from constructor