Xcode File Generator for Clean Code architecture
gem install ccios
To build it from source:
cd ccios
gem build ccios.gemspec
gem install ./ccios-x.x.x.gem
To run the tests run:
rake test
Go to your .xcodeproj
folder cd /paht/to/my/xcodeproj
.
Then generate files with prefix Example
:
ccios [-p|-i|-r|-c] Example [-d]
Generated templates can be found here
-p
stands for presenter
This generates 4 files: ExampleViewController
, ExampleViewContract
, ExamplePresenter
, ExamplePresenterImplementation
. If the -d
option is supplied the protocol ExamplePresenterDelegate
will be generated.
What's more it prints the code you need to add to DependencyProvider.swift
and PresenterAssembly.swift
for dependency injection.
The following structure is created for you in the Xcode project:
.
+-- App/
| +-- Example/
| | +-- UI/
| | | +-- View/
| | | +-- ViewController/
| | | | +-- ExampleViewController
| | | +-- ExampleViewContract
| | +-- Presenter/
| | | +-- ExamplePresenter
| | | +-- ExamplePresenterImplementation
| | +-- Model/
-i
stands for interactor
This generates 2 files: ExampleInteractor
and ExampleInteractorImplementation
.
What's more it prints the code you need to add to InteractorAssembly.swift
for dependency injection.
The following structure is created for you in the Xcode project:
.
+-- Core/
| +-- Interactor/
| | +-- ExampleInteractor/
| | | +-- ExampleInteractor
| | | +-- ExampleInteractorImplementation
-r
stands for repository
This generates 2 files: ExampleRepository
and ExampleRepositoryImplementation
.
What's more it prints the code you need to add to RepositoryAssembly.swift
for dependency injection.
The following structure is created for you in the Xcode project:
.
+-- Core/
| +-- Data/
| | +-- Example
| | | +-- ExampleRepository
+-- Data/
| +-- Example
| | +-- ExampleRepositoryImplementation
-c
stands for coordinator
This generates one file: ExampleCoordinator
. If the -d
option is supplied the protocol ExampleCoordinatorDelegate
will be generated.
The following structure is created for you in the Xcode project:
.
+-- Coordinator/
| +-- ExampleCoordinator