Skip to content

Commit

Permalink
Added convenience init so you can initialize VIPER modules with code …
Browse files Browse the repository at this point in the history
…created View Controllers (without .xib).
  • Loading branch information
dresetnic committed Jul 14, 2019
1 parent 2667068 commit 143c576
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions swifty_viper/Code/Configurator/initializer.swift.liquid
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

//
// {{ prefix }}{{ module_info.name }}{{ module_info.file_name }}
// {{ module_info.project_name }}
Expand All @@ -19,4 +20,10 @@ class {{ module_info.name }}ModuleInitializer: NSObject {
configurator.configureModuleForViewInput({{ module_info.name | downcase }}ViewController)
}

convenience init({{ module_info.name | downcase }}ViewController: {{ module_info.name }}ViewController) {
self.init()
let configurator = {{ module_info.name }}ModuleConfigurator()
configurator.configureModuleForViewInput(viewInput: {{ module_info.name | downcase }}ViewController)
}

}

0 comments on commit 143c576

Please sign in to comment.