diff --git a/Base VIPER Interfaces V1/BaseWireframe.swift b/Base VIPER Interfaces V1/BaseWireframe.swift deleted file mode 100755 index b3eda51..0000000 --- a/Base VIPER Interfaces V1/BaseWireframe.swift +++ /dev/null @@ -1,46 +0,0 @@ -import UIKit - -enum Transition { - case root - case push - case present(fromViewController: UIViewController) -} - -protocol WireframeInterface: class { - func popFromNavigationController(animated: Bool) - func dismiss(animated: Bool) -} - -class BaseWireframe { - - unowned var navigationController: UINavigationController - - init(navigationController: UINavigationController) { - self.navigationController = navigationController - } - - func show(_ viewController: UIViewController, with transition: Transition, animated: Bool) { - switch transition { - case .push: - navigationController.pushViewController(viewController, animated: animated) - case .present(let fromViewController): - navigationController.viewControllers = [viewController] - fromViewController.present(navigationController, animated: animated, completion: nil) - case .root: - navigationController.setViewControllers([viewController], animated: animated) - } - } - -} - -extension BaseWireframe: WireframeInterface { - - func popFromNavigationController(animated: Bool) { - let _ = navigationController.popViewController(animated: animated) - } - - func dismiss(animated: Bool) { - navigationController.dismiss(animated: animated) - } - -} diff --git a/Base VIPER Interfaces V1/PresenterInterface.swift b/Base VIPER Interfaces V1/PresenterInterface.swift deleted file mode 100755 index a374052..0000000 --- a/Base VIPER Interfaces V1/PresenterInterface.swift +++ /dev/null @@ -1,31 +0,0 @@ -protocol PresenterInterface: class { - func viewDidLoad() - func viewWillAppear(animated: Bool) - func viewDidAppear(animated: Bool) - func viewWillDisappear(animated: Bool) - func viewDidDisappear(animated: Bool) -} - -extension PresenterInterface { - - func viewDidLoad() { - fatalError("Implementation pending...") - } - - func viewWillAppear(animated: Bool) { - fatalError("Implementation pending...") - } - - func viewDidAppear(animated: Bool) { - fatalError("Implementation pending...") - } - - func viewWillDisappear(animated: Bool) { - fatalError("Implementation pending...") - } - - func viewDidDisappear(animated: Bool) { - fatalError("Implementation pending...") - } - -} diff --git a/Base VIPER Interfaces V2/InteractorInterface.swift b/Base VIPER Interfaces V2/InteractorInterface.swift deleted file mode 100644 index 9f0fb64..0000000 --- a/Base VIPER Interfaces V2/InteractorInterface.swift +++ /dev/null @@ -1,5 +0,0 @@ -protocol InteractorInterface: class { -} - -extension InteractorInterface { -} diff --git a/Base VIPER Interfaces V2/PresenterInterface.swift b/Base VIPER Interfaces V2/PresenterInterface.swift deleted file mode 100644 index a374052..0000000 --- a/Base VIPER Interfaces V2/PresenterInterface.swift +++ /dev/null @@ -1,31 +0,0 @@ -protocol PresenterInterface: class { - func viewDidLoad() - func viewWillAppear(animated: Bool) - func viewDidAppear(animated: Bool) - func viewWillDisappear(animated: Bool) - func viewDidDisappear(animated: Bool) -} - -extension PresenterInterface { - - func viewDidLoad() { - fatalError("Implementation pending...") - } - - func viewWillAppear(animated: Bool) { - fatalError("Implementation pending...") - } - - func viewDidAppear(animated: Bool) { - fatalError("Implementation pending...") - } - - func viewWillDisappear(animated: Bool) { - fatalError("Implementation pending...") - } - - func viewDidDisappear(animated: Bool) { - fatalError("Implementation pending...") - } - -} diff --git a/Base VIPER Interfaces V2/UIStoryboardExtension.swift b/Base VIPER Interfaces V2/UIStoryboardExtension.swift deleted file mode 100644 index 181086c..0000000 --- a/Base VIPER Interfaces V2/UIStoryboardExtension.swift +++ /dev/null @@ -1,10 +0,0 @@ -import UIKit - -extension UIStoryboard { - - func instantiateViewController(ofType _: T.Type, withIdentifier identifier: String? = nil) -> T { - let identifier = identifier ?? String(describing: T.self) - return instantiateViewController(withIdentifier: identifier) as! T - } - -} diff --git a/Base VIPER Interfaces V2/ViewInterface.swift b/Base VIPER Interfaces V2/ViewInterface.swift deleted file mode 100644 index 0966b94..0000000 --- a/Base VIPER Interfaces V2/ViewInterface.swift +++ /dev/null @@ -1,5 +0,0 @@ -protocol ViewInterface: class { -} - -extension ViewInterface { -} diff --git a/Base VIPER Interfaces V2/BaseWireframe.swift b/Base VIPER Interfaces/BaseWireframe.swift similarity index 100% rename from Base VIPER Interfaces V2/BaseWireframe.swift rename to Base VIPER Interfaces/BaseWireframe.swift diff --git a/Base VIPER Interfaces/FormatterInterface.swift b/Base VIPER Interfaces/FormatterInterface.swift new file mode 100644 index 0000000..2b30f34 --- /dev/null +++ b/Base VIPER Interfaces/FormatterInterface.swift @@ -0,0 +1,5 @@ +protocol FormatterInterface: class { +} + +extension FormatterInterface { +} diff --git a/Base VIPER Interfaces V1/InteractorInterface.swift b/Base VIPER Interfaces/InteractorInterface.swift old mode 100755 new mode 100644 similarity index 100% rename from Base VIPER Interfaces V1/InteractorInterface.swift rename to Base VIPER Interfaces/InteractorInterface.swift diff --git a/Base VIPER Interfaces/PresenterInterface.swift b/Base VIPER Interfaces/PresenterInterface.swift new file mode 100644 index 0000000..c3b1739 --- /dev/null +++ b/Base VIPER Interfaces/PresenterInterface.swift @@ -0,0 +1,5 @@ +protocol PresenterInterface: class { +} + +extension PresenterInterface { +} diff --git a/Base VIPER Interfaces V1/UIStoryboardExtension.swift b/Base VIPER Interfaces/UIStoryboardExtension.swift old mode 100755 new mode 100644 similarity index 100% rename from Base VIPER Interfaces V1/UIStoryboardExtension.swift rename to Base VIPER Interfaces/UIStoryboardExtension.swift diff --git a/Base VIPER Interfaces V1/ViewInterface.swift b/Base VIPER Interfaces/ViewInterface.swift old mode 100755 new mode 100644 similarity index 100% rename from Base VIPER Interfaces V1/ViewInterface.swift rename to Base VIPER Interfaces/ViewInterface.swift diff --git a/Makefile b/Makefile index 25d3f52..060941d 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ XCODE_USER_TEMPLATES_DIR=~/Library/Developer/Xcode/Templates/File\ Templates -VIPER_TEMPLATES_DIR=VIPER\ Templates +VIPER_TEMPLATES_DIR=Templates/VIPER\ Templates install_templates: rm -R -f $(XCODE_USER_TEMPLATES_DIR)/$(VIPER_TEMPLATES_DIR) @@ -7,4 +7,4 @@ install_templates: cp -R -f $(VIPER_TEMPLATES_DIR) $(XCODE_USER_TEMPLATES_DIR) uninstall_templates: - rm -R $(XCODE_USER_TEMPLATES_DIR)/$(VIPER_TEMPLATES_DIR) + rm -R $(XCODE_USER_TEMPLATES_DIR)/$(VIPER_TEMPLATES_DIR) \ No newline at end of file diff --git a/README.md b/README.md index 9dd21c8..2a12990 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,8 @@ ![iOS VIPER](/Images/ios_viper_logo.png "iOS VIPER") # Versions -Latest version is v2. You can still use initial v1 of the VIPER templates generator. v2 has breaking changes in base VIPER methods related to wireframe setup and navigation and is recommended to use it if starting a new project. It's not backwards compatible with v1. +Latest version is v3. +You can find older versions in [version/2.0 branch](https://github.com/infinum/iOS-VIPER-Xcode-Templates/tree/version/2.0). # Installation instructions @@ -31,8 +32,9 @@ Let's go over the basics quickly - the main components of VIPER are as follows: * **View**: contains UI logic and knows how to layout and animate itself. It displays what it's _told_ by the Presenter and it _delegates_ user interaction actions to the Presenter. Ideally it contains no business logic, only view logic. * **Interactor**: used for fetching data when requested by the Presenter, regardless of where the data is coming from. Contains only business logic. -* **Presenter**: prepares the content which it receives from the Interactor to be presented by the View. Contains business and view logic - basically it connects the two. +* **Presenter**: also known as the event handler. Handles all the communication with view, interactor and wireframe. Contains presentation logic - basically it controllers the module. * **Entity**: models which are handled by the Interactor. Contains only business logic, but primarily data, not rules. +* **Formatter**(new): handles formatting logic. Sits between presenter and the view. It formats the data from the business world into something that can be consumed by the view. * **Router**: handles navigation logic. In our case we use components called Wireframes for this responsibility. ## Components @@ -43,6 +45,7 @@ Module components: * **View** * **Presenter** * **Interactor** (not mandatory) +* **Formatter** (not mandatory) * **Wireframe** In some simpler cases you won't need an Interactor for a certain module, which is why this component is not mandatory. These are cases where you don't need to fetch any data, which is usually not common. diff --git a/VIPER Templates/Module V1.xctemplate/TemplateIcon.png b/Templates/Resources/Images/TemplateIcon.png similarity index 100% rename from VIPER Templates/Module V1.xctemplate/TemplateIcon.png rename to Templates/Resources/Images/TemplateIcon.png diff --git a/VIPER Templates/Module V1.xctemplate/TemplateIcon@2x.png b/Templates/Resources/Images/TemplateIcon@2x.png similarity index 100% rename from VIPER Templates/Module V1.xctemplate/TemplateIcon@2x.png rename to Templates/Resources/Images/TemplateIcon@2x.png diff --git a/VIPER Templates/Module V1.xctemplate/TemplateIcon@3x.png b/Templates/Resources/Images/TemplateIcon@3x.png similarity index 100% rename from VIPER Templates/Module V1.xctemplate/TemplateIcon@3x.png rename to Templates/Resources/Images/TemplateIcon@3x.png diff --git a/Templates/Resources/TemplateInfo.plist.erb b/Templates/Resources/TemplateInfo.plist.erb new file mode 100755 index 0000000..5baa398 --- /dev/null +++ b/Templates/Resources/TemplateInfo.plist.erb @@ -0,0 +1,81 @@ + + + + + DefaultCompletionName + VIPERModule + Description + This generates a new Module using 🐍VIPER generator. + Kind + Xcode.IDEKit.TextSubstitutionFileTemplateKind + Options + + + Description + The name of the module to create + Default + + Identifier + moduleName + Name + New <%= @template.name %> Name: + Required + YES + Type + text + + + Default + ___VARIABLE_moduleName___ + Identifier + productName + Type + static + + + Identifier + interface + Name + Generate Interface Builder: + Description + Which interface builder to generate + Type + popup + Default + <%= @interface.default.name%> + Values + + <%- @interface.types.each do |type| -%> + <%= type.name %> + <%- end -%> + + + + Identifier + complex + Name + Module Complexity: + Description + Type of a module to generate - simple, with interactor, or with interactor and formatter + Type + popup + Default + <%= @complexity.default.name%> + Values + + <%- @complexity.types.each do |type| -%> + <%= type.name %> + <%- end -%> + + + + Platforms + + com.apple.platform.iphoneos + + SortOrder + 1 + Summary + This generates a new 🐍 VIPER module. + + diff --git a/Templates/Resources/Templates/___FILEBASENAME___.storyboard.erb b/Templates/Resources/Templates/___FILEBASENAME___.storyboard.erb new file mode 100644 index 0000000..121f30b --- /dev/null +++ b/Templates/Resources/Templates/___FILEBASENAME___.storyboard.erb @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Templates/Resources/Templates/___FILEBASENAME___Formatter.swift.erb b/Templates/Resources/Templates/___FILEBASENAME___Formatter.swift.erb new file mode 100644 index 0000000..3d1cd7d --- /dev/null +++ b/Templates/Resources/Templates/___FILEBASENAME___Formatter.swift.erb @@ -0,0 +1,30 @@ +// +// ___FILENAME___ +// ___PROJECTNAME___ +// +// Created by ___FULLUSERNAME___ on ___DATE___. +// Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. +// +// This file was generated by the 🐍 VIPER generator +// + +import UIKit +<% if @template.generate_io -%> +import RxSwift +import RxCocoa +<% end -%> + +final class ___VARIABLE_moduleName___Formatter { +} + +// MARK: - Extensions - + +extension ___VARIABLE_moduleName___Formatter: ___VARIABLE_moduleName___FormatterInterface { + <%- if @template.generate_io -%> + + func format(for input: ___VARIABLE_moduleName___.FormatterInput) -> ___VARIABLE_moduleName___.FormatterOutput { + return ___VARIABLE_moduleName___.FormatterOutput() + } + + <%- end -%> +} diff --git a/Templates/Resources/Templates/___FILEBASENAME___Interactor.swift.erb b/Templates/Resources/Templates/___FILEBASENAME___Interactor.swift.erb new file mode 100644 index 0000000..9ac5db0 --- /dev/null +++ b/Templates/Resources/Templates/___FILEBASENAME___Interactor.swift.erb @@ -0,0 +1,22 @@ +// +// ___FILENAME___ +// ___PROJECTNAME___ +// +// Created by ___FULLUSERNAME___ on ___DATE___. +// Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. +// +// This file was generated by the 🐍 VIPER generator +// + +import Foundation +<% if @template.generate_io -%> +import RxSwift +<% end -%> + +final class ___VARIABLE_moduleName___Interactor { +} + +// MARK: - Extensions - + +extension ___VARIABLE_moduleName___Interactor: ___VARIABLE_moduleName___InteractorInterface { +} diff --git a/Templates/Resources/Templates/___FILEBASENAME___Interfaces.swift.erb b/Templates/Resources/Templates/___FILEBASENAME___Interfaces.swift.erb new file mode 100644 index 0000000..101217e --- /dev/null +++ b/Templates/Resources/Templates/___FILEBASENAME___Interfaces.swift.erb @@ -0,0 +1,63 @@ +// +// ___FILENAME___ +// ___PROJECTNAME___ +// +// Created by ___FULLUSERNAME___ on ___DATE___. +// Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. +// +// This file was generated by the 🐍 VIPER generator +// + +import UIKit +<% if @template.generate_io -%> +import RxSwift +import RxCocoa +<% end -%> +<% if @template.generate_io -%> + +enum ___VARIABLE_moduleName___ { + + struct ViewOutput { + } + + struct ViewInput { + <%- if @complexity.generate_formatter -%> + let models: FormatterOutput + <%- end -%> + } + + <%- if @complexity.generate_formatter -%> + struct FormatterInput { + } + + struct FormatterOutput { + } + + <%- end -%> +} +<% end -%> + +protocol ___VARIABLE_moduleName___WireframeInterface: WireframeInterface { +} + +protocol ___VARIABLE_moduleName___ViewInterface: ViewInterface { +} + +protocol ___VARIABLE_moduleName___PresenterInterface: PresenterInterface { +<% if @template.generate_io -%> + func configure(with output: ___VARIABLE_moduleName___.ViewOutput) -> ___VARIABLE_moduleName___.ViewInput +<% end -%> +} +<% if @complexity.generate_formatter -%> + +protocol ___VARIABLE_moduleName___FormatterInterface: FormatterInterface { + <%- if @template.generate_io -%> + func format(for input: ___VARIABLE_moduleName___.FormatterInput) -> ___VARIABLE_moduleName___.FormatterOutput + <%- end -%> +} +<% end -%> +<% if @complexity.generate_interactor -%> + +protocol ___VARIABLE_moduleName___InteractorInterface: InteractorInterface { +} +<% end -%> \ No newline at end of file diff --git a/Templates/Resources/Templates/___FILEBASENAME___Presenter.swift.erb b/Templates/Resources/Templates/___FILEBASENAME___Presenter.swift.erb new file mode 100644 index 0000000..8e64888 --- /dev/null +++ b/Templates/Resources/Templates/___FILEBASENAME___Presenter.swift.erb @@ -0,0 +1,61 @@ +// +// ___FILENAME___ +// ___PROJECTNAME___ +// +// Created by ___FULLUSERNAME___ on ___DATE___. +// Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. +// +// This file was generated by the 🐍 VIPER generator +// + +import UIKit +<% if @template.generate_io -%> +import RxSwift +import RxCocoa +<% end -%> + +final class ___VARIABLE_moduleName___Presenter { + + // MARK: - Private properties - + + private unowned let view: ___VARIABLE_moduleName___ViewInterface +<% if @complexity.generate_formatter -%> + private let formatter: ___VARIABLE_moduleName___FormatterInterface +<% end -%> +<% if @complexity.generate_interactor -%> + private let interactor: ___VARIABLE_moduleName___InteractorInterface +<% end -%> + private let wireframe: ___VARIABLE_moduleName___WireframeInterface + + // MARK: - Lifecycle - + + init(view: ___VARIABLE_moduleName___ViewInterface, <%= @complexity.generate_formatter ? 'formatter: ___VARIABLE_moduleName___FormatterInterface, ' : '' %><%= @complexity.generate_interactor ? 'interactor: ___VARIABLE_moduleName___InteractorInterface, ' : '' %>wireframe: ___VARIABLE_moduleName___WireframeInterface) { + self.view = view + <%- if @complexity.generate_formatter -%> + self.formatter = formatter + <%- end -%> + <%- if @complexity.generate_interactor -%> + self.interactor = interactor + <%- end -%> + self.wireframe = wireframe + } +} + +// MARK: - Extensions - + +extension ___VARIABLE_moduleName___Presenter: ___VARIABLE_moduleName___PresenterInterface { + <%- if @template.generate_io -%> + + func configure(with output: ___VARIABLE_moduleName___.ViewOutput) -> ___VARIABLE_moduleName___.ViewInput { + <%- if @complexity.generate_formatter -%> + + let formatterInput = ___VARIABLE_moduleName___.FormatterInput() + + let formatterOutput = formatter.format(for: formatterInput) + + <%- end -%> + return ___VARIABLE_moduleName___.ViewInput(<%= @complexity.generate_formatter ? 'models: formatterOutput' : '' %>) + } + + <%- end -%> +} diff --git a/Templates/Resources/Templates/___FILEBASENAME___ViewController.swift.erb b/Templates/Resources/Templates/___FILEBASENAME___ViewController.swift.erb new file mode 100644 index 0000000..fa89ded --- /dev/null +++ b/Templates/Resources/Templates/___FILEBASENAME___ViewController.swift.erb @@ -0,0 +1,55 @@ +// +// ___FILENAME___ +// ___PROJECTNAME___ +// +// Created by ___FULLUSERNAME___ on ___DATE___. +// Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. +// +// This file was generated by the 🐍 VIPER generator +// + +import UIKit +<% if @template.generate_io -%> +import RxSwift +import RxCocoa +<% end -%> + +final class ___VARIABLE_moduleName___ViewController: UIViewController { + + // MARK: - Public properties - + + var presenter: ___VARIABLE_moduleName___PresenterInterface! + + <%- if @template.generate_io -%> + // MARK: - Private properties - + + private let disposeBag = DisposeBag() + + <%- end -%> + // MARK: - Lifecycle - + + override func viewDidLoad() { + super.viewDidLoad() + <%- if @template.generate_io -%> + configure() + <%- end -%> + } + +} + +// MARK: - Extensions - + +extension ___VARIABLE_moduleName___ViewController: ___VARIABLE_moduleName___ViewInterface { +} +<%- if @template.generate_io -%> + +private extension ___VARIABLE_moduleName___ViewController { + + func configure() { + let output = ___VARIABLE_moduleName___.ViewOutput() + + let input = presenter.configure(with: output) + } + +} +<%- end -%> \ No newline at end of file diff --git a/Templates/Resources/Templates/___FILEBASENAME___ViewController.xib.erb b/Templates/Resources/Templates/___FILEBASENAME___ViewController.xib.erb new file mode 100644 index 0000000..949017e --- /dev/null +++ b/Templates/Resources/Templates/___FILEBASENAME___ViewController.xib.erb @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/Templates/Resources/Templates/___FILEBASENAME___Wireframe.swift.erb b/Templates/Resources/Templates/___FILEBASENAME___Wireframe.swift.erb new file mode 100644 index 0000000..2a3d3c1 --- /dev/null +++ b/Templates/Resources/Templates/___FILEBASENAME___Wireframe.swift.erb @@ -0,0 +1,54 @@ +// +// ___FILENAME___ +// ___PROJECTNAME___ +// +// Created by ___FULLUSERNAME___ on ___DATE___. +// Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. +// +// This file was generated by the 🐍 VIPER generator +// + +import UIKit +<% if @template.generate_io -%> +import RxSwift +import RxCocoa +<% end -%> + +final class ___VARIABLE_moduleName___Wireframe: BaseWireframe { + +<% if !@interface.generate_xib -%> + // MARK: - Private properties - + + <%- if @interface.generate_sb -%> + private let storyboard = UIStoryboard(name: "___VARIABLE_moduleName___", bundle: nil) + <%- else -%> + private let storyboard = UIStoryboard(name: "<#___VARIABLE_moduleName___#>", bundle: nil) + <%- end -%> + +<% end -%> + // MARK: - Module setup - + + init() { + <%- if @interface.generate_xib -%> + let moduleViewController = ___VARIABLE_moduleName___ViewController() + <%- else -%> + let moduleViewController = storyboard.instantiateViewController(ofType: ___VARIABLE_moduleName___ViewController.self) + <%- end -%> + super.init(viewController: moduleViewController) + + <%- if @complexity.generate_formatter -%> + let formatter = ___VARIABLE_moduleName___Formatter() + <%- end -%> + <%- if @complexity.generate_interactor -%> + let interactor = ___VARIABLE_moduleName___Interactor() + <%- end -%> + let presenter = ___VARIABLE_moduleName___Presenter(view: moduleViewController, <%= @complexity.generate_formatter ? 'formatter: formatter, ' : '' %><%= @complexity.generate_interactor ? 'interactor: interactor, ' : '' %>wireframe: self) + moduleViewController.presenter = presenter + } + +} + +// MARK: - Extensions - + +extension ___VARIABLE_moduleName___Wireframe: ___VARIABLE_moduleName___WireframeInterface { +} diff --git a/VIPER Templates/Module V1.xctemplate/UIViewController/___FILEBASENAME___Interactor.swift b/Templates/VIPER Templates/Module.xctemplate/NoneInteractor/___FILEBASENAME___Interactor.swift old mode 100755 new mode 100644 similarity index 100% rename from VIPER Templates/Module V1.xctemplate/UIViewController/___FILEBASENAME___Interactor.swift rename to Templates/VIPER Templates/Module.xctemplate/NoneInteractor/___FILEBASENAME___Interactor.swift diff --git a/Templates/VIPER Templates/Module.xctemplate/NoneInteractor/___FILEBASENAME___Interfaces.swift b/Templates/VIPER Templates/Module.xctemplate/NoneInteractor/___FILEBASENAME___Interfaces.swift new file mode 100644 index 0000000..c3bebb6 --- /dev/null +++ b/Templates/VIPER Templates/Module.xctemplate/NoneInteractor/___FILEBASENAME___Interfaces.swift @@ -0,0 +1,23 @@ +// +// ___FILENAME___ +// ___PROJECTNAME___ +// +// Created by ___FULLUSERNAME___ on ___DATE___. +// Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. +// +// This file was generated by the 🐍 VIPER generator +// + +import UIKit + +protocol ___VARIABLE_moduleName___WireframeInterface: WireframeInterface { +} + +protocol ___VARIABLE_moduleName___ViewInterface: ViewInterface { +} + +protocol ___VARIABLE_moduleName___PresenterInterface: PresenterInterface { +} + +protocol ___VARIABLE_moduleName___InteractorInterface: InteractorInterface { +} diff --git a/VIPER Templates/Module V1.xctemplate/UIViewController/___FILEBASENAME___Presenter.swift b/Templates/VIPER Templates/Module.xctemplate/NoneInteractor/___FILEBASENAME___Presenter.swift old mode 100755 new mode 100644 similarity index 50% rename from VIPER Templates/Module V1.xctemplate/UIViewController/___FILEBASENAME___Presenter.swift rename to Templates/VIPER Templates/Module.xctemplate/NoneInteractor/___FILEBASENAME___Presenter.swift index 0579bab..51cc5ea --- a/VIPER Templates/Module V1.xctemplate/UIViewController/___FILEBASENAME___Presenter.swift +++ b/Templates/VIPER Templates/Module.xctemplate/NoneInteractor/___FILEBASENAME___Presenter.swift @@ -14,18 +14,16 @@ final class ___VARIABLE_moduleName___Presenter { // MARK: - Private properties - - private unowned let _view: ___VARIABLE_moduleName___ViewInterface - private let _interactor: ___VARIABLE_moduleName___InteractorInterface - private let _wireframe: ___VARIABLE_moduleName___WireframeInterface + private unowned let view: ___VARIABLE_moduleName___ViewInterface + private let interactor: ___VARIABLE_moduleName___InteractorInterface + private let wireframe: ___VARIABLE_moduleName___WireframeInterface // MARK: - Lifecycle - - init(wireframe: ___VARIABLE_moduleName___WireframeInterface, - view: ___VARIABLE_moduleName___ViewInterface, - interactor: ___VARIABLE_moduleName___InteractorInterface) { - _wireframe = wireframe - _view = view - _interactor = interactor + init(view: ___VARIABLE_moduleName___ViewInterface, interactor: ___VARIABLE_moduleName___InteractorInterface, wireframe: ___VARIABLE_moduleName___WireframeInterface) { + self.view = view + self.interactor = interactor + self.wireframe = wireframe } } diff --git a/VIPER Templates/Module V2.xctemplate/Default/___FILEBASENAME___ViewController.swift b/Templates/VIPER Templates/Module.xctemplate/NoneInteractor/___FILEBASENAME___ViewController.swift similarity index 100% rename from VIPER Templates/Module V2.xctemplate/Default/___FILEBASENAME___ViewController.swift rename to Templates/VIPER Templates/Module.xctemplate/NoneInteractor/___FILEBASENAME___ViewController.swift diff --git a/VIPER Templates/Module V2.xctemplate/Default/___FILEBASENAME___Wireframe.swift b/Templates/VIPER Templates/Module.xctemplate/NoneInteractor/___FILEBASENAME___Wireframe.swift similarity index 62% rename from VIPER Templates/Module V2.xctemplate/Default/___FILEBASENAME___Wireframe.swift rename to Templates/VIPER Templates/Module.xctemplate/NoneInteractor/___FILEBASENAME___Wireframe.swift index 12a61b2..40ba967 100644 --- a/VIPER Templates/Module V2.xctemplate/Default/___FILEBASENAME___Wireframe.swift +++ b/Templates/VIPER Templates/Module.xctemplate/NoneInteractor/___FILEBASENAME___Wireframe.swift @@ -14,16 +14,16 @@ final class ___VARIABLE_moduleName___Wireframe: BaseWireframe { // MARK: - Private properties - - private let _storyboard = UIStoryboard(name: <#Storyboard name#>, bundle: nil) + private let storyboard = UIStoryboard(name: "<#___VARIABLE_moduleName___#>", bundle: nil) // MARK: - Module setup - init() { - let moduleViewController = _storyboard.instantiateViewController(ofType: ___VARIABLE_moduleName___ViewController.self) + let moduleViewController = storyboard.instantiateViewController(ofType: ___VARIABLE_moduleName___ViewController.self) super.init(viewController: moduleViewController) let interactor = ___VARIABLE_moduleName___Interactor() - let presenter = ___VARIABLE_moduleName___Presenter(wireframe: self, view: moduleViewController, interactor: interactor) + let presenter = ___VARIABLE_moduleName___Presenter(view: moduleViewController, interactor: interactor, wireframe: self) moduleViewController.presenter = presenter } @@ -32,7 +32,4 @@ final class ___VARIABLE_moduleName___Wireframe: BaseWireframe { // MARK: - Extensions - extension ___VARIABLE_moduleName___Wireframe: ___VARIABLE_moduleName___WireframeInterface { - - func navigate(to option: ___VARIABLE_moduleName___NavigationOption) { - } } diff --git a/Templates/VIPER Templates/Module.xctemplate/NoneInteractorAndFormatter/___FILEBASENAME___Formatter.swift b/Templates/VIPER Templates/Module.xctemplate/NoneInteractorAndFormatter/___FILEBASENAME___Formatter.swift new file mode 100644 index 0000000..7ea487f --- /dev/null +++ b/Templates/VIPER Templates/Module.xctemplate/NoneInteractorAndFormatter/___FILEBASENAME___Formatter.swift @@ -0,0 +1,19 @@ +// +// ___FILENAME___ +// ___PROJECTNAME___ +// +// Created by ___FULLUSERNAME___ on ___DATE___. +// Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. +// +// This file was generated by the 🐍 VIPER generator +// + +import UIKit + +final class ___VARIABLE_moduleName___Formatter { +} + +// MARK: - Extensions - + +extension ___VARIABLE_moduleName___Formatter: ___VARIABLE_moduleName___FormatterInterface { +} diff --git a/VIPER Templates/Module V2.xctemplate/Default/___FILEBASENAME___Interactor.swift b/Templates/VIPER Templates/Module.xctemplate/NoneInteractorAndFormatter/___FILEBASENAME___Interactor.swift similarity index 100% rename from VIPER Templates/Module V2.xctemplate/Default/___FILEBASENAME___Interactor.swift rename to Templates/VIPER Templates/Module.xctemplate/NoneInteractorAndFormatter/___FILEBASENAME___Interactor.swift diff --git a/VIPER Templates/Module V2.xctemplate/Default/___FILEBASENAME___Interfaces.swift b/Templates/VIPER Templates/Module.xctemplate/NoneInteractorAndFormatter/___FILEBASENAME___Interfaces.swift similarity index 82% rename from VIPER Templates/Module V2.xctemplate/Default/___FILEBASENAME___Interfaces.swift rename to Templates/VIPER Templates/Module.xctemplate/NoneInteractorAndFormatter/___FILEBASENAME___Interfaces.swift index 2fd41a7..a9473d4 100644 --- a/VIPER Templates/Module V2.xctemplate/Default/___FILEBASENAME___Interfaces.swift +++ b/Templates/VIPER Templates/Module.xctemplate/NoneInteractorAndFormatter/___FILEBASENAME___Interfaces.swift @@ -10,11 +10,7 @@ import UIKit -enum ___VARIABLE_moduleName___NavigationOption { -} - protocol ___VARIABLE_moduleName___WireframeInterface: WireframeInterface { - func navigate(to option: ___VARIABLE_moduleName___NavigationOption) } protocol ___VARIABLE_moduleName___ViewInterface: ViewInterface { @@ -23,5 +19,8 @@ protocol ___VARIABLE_moduleName___ViewInterface: ViewInterface { protocol ___VARIABLE_moduleName___PresenterInterface: PresenterInterface { } +protocol ___VARIABLE_moduleName___FormatterInterface: FormatterInterface { +} + protocol ___VARIABLE_moduleName___InteractorInterface: InteractorInterface { } diff --git a/Templates/VIPER Templates/Module.xctemplate/NoneInteractorAndFormatter/___FILEBASENAME___Presenter.swift b/Templates/VIPER Templates/Module.xctemplate/NoneInteractorAndFormatter/___FILEBASENAME___Presenter.swift new file mode 100644 index 0000000..22e31e4 --- /dev/null +++ b/Templates/VIPER Templates/Module.xctemplate/NoneInteractorAndFormatter/___FILEBASENAME___Presenter.swift @@ -0,0 +1,35 @@ +// +// ___FILENAME___ +// ___PROJECTNAME___ +// +// Created by ___FULLUSERNAME___ on ___DATE___. +// Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. +// +// This file was generated by the 🐍 VIPER generator +// + +import UIKit + +final class ___VARIABLE_moduleName___Presenter { + + // MARK: - Private properties - + + private unowned let view: ___VARIABLE_moduleName___ViewInterface + private let formatter: ___VARIABLE_moduleName___FormatterInterface + private let interactor: ___VARIABLE_moduleName___InteractorInterface + private let wireframe: ___VARIABLE_moduleName___WireframeInterface + + // MARK: - Lifecycle - + + init(view: ___VARIABLE_moduleName___ViewInterface, formatter: ___VARIABLE_moduleName___FormatterInterface, interactor: ___VARIABLE_moduleName___InteractorInterface, wireframe: ___VARIABLE_moduleName___WireframeInterface) { + self.view = view + self.formatter = formatter + self.interactor = interactor + self.wireframe = wireframe + } +} + +// MARK: - Extensions - + +extension ___VARIABLE_moduleName___Presenter: ___VARIABLE_moduleName___PresenterInterface { +} diff --git a/VIPER Templates/Module V2.xctemplate/Storyboard/___FILEBASENAME___ViewController.swift b/Templates/VIPER Templates/Module.xctemplate/NoneInteractorAndFormatter/___FILEBASENAME___ViewController.swift similarity index 100% rename from VIPER Templates/Module V2.xctemplate/Storyboard/___FILEBASENAME___ViewController.swift rename to Templates/VIPER Templates/Module.xctemplate/NoneInteractorAndFormatter/___FILEBASENAME___ViewController.swift diff --git a/Templates/VIPER Templates/Module.xctemplate/NoneInteractorAndFormatter/___FILEBASENAME___Wireframe.swift b/Templates/VIPER Templates/Module.xctemplate/NoneInteractorAndFormatter/___FILEBASENAME___Wireframe.swift new file mode 100644 index 0000000..d91d43d --- /dev/null +++ b/Templates/VIPER Templates/Module.xctemplate/NoneInteractorAndFormatter/___FILEBASENAME___Wireframe.swift @@ -0,0 +1,36 @@ +// +// ___FILENAME___ +// ___PROJECTNAME___ +// +// Created by ___FULLUSERNAME___ on ___DATE___. +// Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. +// +// This file was generated by the 🐍 VIPER generator +// + +import UIKit + +final class ___VARIABLE_moduleName___Wireframe: BaseWireframe { + + // MARK: - Private properties - + + private let storyboard = UIStoryboard(name: "<#___VARIABLE_moduleName___#>", bundle: nil) + + // MARK: - Module setup - + + init() { + let moduleViewController = storyboard.instantiateViewController(ofType: ___VARIABLE_moduleName___ViewController.self) + super.init(viewController: moduleViewController) + + let formatter = ___VARIABLE_moduleName___Formatter() + let interactor = ___VARIABLE_moduleName___Interactor() + let presenter = ___VARIABLE_moduleName___Presenter(view: moduleViewController, formatter: formatter, interactor: interactor, wireframe: self) + moduleViewController.presenter = presenter + } + +} + +// MARK: - Extensions - + +extension ___VARIABLE_moduleName___Wireframe: ___VARIABLE_moduleName___WireframeInterface { +} diff --git a/Templates/VIPER Templates/Module.xctemplate/NoneSimple/___FILEBASENAME___Interfaces.swift b/Templates/VIPER Templates/Module.xctemplate/NoneSimple/___FILEBASENAME___Interfaces.swift new file mode 100644 index 0000000..3366117 --- /dev/null +++ b/Templates/VIPER Templates/Module.xctemplate/NoneSimple/___FILEBASENAME___Interfaces.swift @@ -0,0 +1,20 @@ +// +// ___FILENAME___ +// ___PROJECTNAME___ +// +// Created by ___FULLUSERNAME___ on ___DATE___. +// Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. +// +// This file was generated by the 🐍 VIPER generator +// + +import UIKit + +protocol ___VARIABLE_moduleName___WireframeInterface: WireframeInterface { +} + +protocol ___VARIABLE_moduleName___ViewInterface: ViewInterface { +} + +protocol ___VARIABLE_moduleName___PresenterInterface: PresenterInterface { +} diff --git a/VIPER Templates/Module V2.xctemplate/Default/___FILEBASENAME___Presenter.swift b/Templates/VIPER Templates/Module.xctemplate/NoneSimple/___FILEBASENAME___Presenter.swift similarity index 50% rename from VIPER Templates/Module V2.xctemplate/Default/___FILEBASENAME___Presenter.swift rename to Templates/VIPER Templates/Module.xctemplate/NoneSimple/___FILEBASENAME___Presenter.swift index 099a0ab..7995f03 100644 --- a/VIPER Templates/Module V2.xctemplate/Default/___FILEBASENAME___Presenter.swift +++ b/Templates/VIPER Templates/Module.xctemplate/NoneSimple/___FILEBASENAME___Presenter.swift @@ -14,16 +14,14 @@ final class ___VARIABLE_moduleName___Presenter { // MARK: - Private properties - - private unowned let _view: ___VARIABLE_moduleName___ViewInterface - private let _wireframe: ___VARIABLE_moduleName___WireframeInterface - private let _interactor: ___VARIABLE_moduleName___InteractorInterface + private unowned let view: ___VARIABLE_moduleName___ViewInterface + private let wireframe: ___VARIABLE_moduleName___WireframeInterface // MARK: - Lifecycle - - init(wireframe: ___VARIABLE_moduleName___WireframeInterface, view: ___VARIABLE_moduleName___ViewInterface, interactor: ___VARIABLE_moduleName___InteractorInterface) { - _wireframe = wireframe - _view = view - _interactor = interactor + init(view: ___VARIABLE_moduleName___ViewInterface, wireframe: ___VARIABLE_moduleName___WireframeInterface) { + self.view = view + self.wireframe = wireframe } } diff --git a/VIPER Templates/Module V1.xctemplate/UIViewController/___FILEBASENAME___ViewController.swift b/Templates/VIPER Templates/Module.xctemplate/NoneSimple/___FILEBASENAME___ViewController.swift old mode 100755 new mode 100644 similarity index 99% rename from VIPER Templates/Module V1.xctemplate/UIViewController/___FILEBASENAME___ViewController.swift rename to Templates/VIPER Templates/Module.xctemplate/NoneSimple/___FILEBASENAME___ViewController.swift index 9fa6e17..cca6aeb --- a/VIPER Templates/Module V1.xctemplate/UIViewController/___FILEBASENAME___ViewController.swift +++ b/Templates/VIPER Templates/Module.xctemplate/NoneSimple/___FILEBASENAME___ViewController.swift @@ -21,6 +21,7 @@ final class ___VARIABLE_moduleName___ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() } + } // MARK: - Extensions - diff --git a/Templates/VIPER Templates/Module.xctemplate/NoneSimple/___FILEBASENAME___Wireframe.swift b/Templates/VIPER Templates/Module.xctemplate/NoneSimple/___FILEBASENAME___Wireframe.swift new file mode 100644 index 0000000..e83ffe2 --- /dev/null +++ b/Templates/VIPER Templates/Module.xctemplate/NoneSimple/___FILEBASENAME___Wireframe.swift @@ -0,0 +1,34 @@ +// +// ___FILENAME___ +// ___PROJECTNAME___ +// +// Created by ___FULLUSERNAME___ on ___DATE___. +// Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. +// +// This file was generated by the 🐍 VIPER generator +// + +import UIKit + +final class ___VARIABLE_moduleName___Wireframe: BaseWireframe { + + // MARK: - Private properties - + + private let storyboard = UIStoryboard(name: "<#___VARIABLE_moduleName___#>", bundle: nil) + + // MARK: - Module setup - + + init() { + let moduleViewController = storyboard.instantiateViewController(ofType: ___VARIABLE_moduleName___ViewController.self) + super.init(viewController: moduleViewController) + + let presenter = ___VARIABLE_moduleName___Presenter(view: moduleViewController, wireframe: self) + moduleViewController.presenter = presenter + } + +} + +// MARK: - Extensions - + +extension ___VARIABLE_moduleName___Wireframe: ___VARIABLE_moduleName___WireframeInterface { +} diff --git a/VIPER Templates/Module V2.xctemplate/Storyboard/___FILEBASENAME___.storyboard b/Templates/VIPER Templates/Module.xctemplate/StoryboardInteractor/___FILEBASENAME___.storyboard similarity index 93% rename from VIPER Templates/Module V2.xctemplate/Storyboard/___FILEBASENAME___.storyboard rename to Templates/VIPER Templates/Module.xctemplate/StoryboardInteractor/___FILEBASENAME___.storyboard index 7137d29..121f30b 100644 --- a/VIPER Templates/Module V2.xctemplate/Storyboard/___FILEBASENAME___.storyboard +++ b/Templates/VIPER Templates/Module.xctemplate/StoryboardInteractor/___FILEBASENAME___.storyboard @@ -13,7 +13,7 @@ - + diff --git a/VIPER Templates/Module V2.xctemplate/Storyboard/___FILEBASENAME___Interactor.swift b/Templates/VIPER Templates/Module.xctemplate/StoryboardInteractor/___FILEBASENAME___Interactor.swift similarity index 100% rename from VIPER Templates/Module V2.xctemplate/Storyboard/___FILEBASENAME___Interactor.swift rename to Templates/VIPER Templates/Module.xctemplate/StoryboardInteractor/___FILEBASENAME___Interactor.swift diff --git a/Templates/VIPER Templates/Module.xctemplate/StoryboardInteractor/___FILEBASENAME___Interfaces.swift b/Templates/VIPER Templates/Module.xctemplate/StoryboardInteractor/___FILEBASENAME___Interfaces.swift new file mode 100644 index 0000000..c3bebb6 --- /dev/null +++ b/Templates/VIPER Templates/Module.xctemplate/StoryboardInteractor/___FILEBASENAME___Interfaces.swift @@ -0,0 +1,23 @@ +// +// ___FILENAME___ +// ___PROJECTNAME___ +// +// Created by ___FULLUSERNAME___ on ___DATE___. +// Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. +// +// This file was generated by the 🐍 VIPER generator +// + +import UIKit + +protocol ___VARIABLE_moduleName___WireframeInterface: WireframeInterface { +} + +protocol ___VARIABLE_moduleName___ViewInterface: ViewInterface { +} + +protocol ___VARIABLE_moduleName___PresenterInterface: PresenterInterface { +} + +protocol ___VARIABLE_moduleName___InteractorInterface: InteractorInterface { +} diff --git a/Templates/VIPER Templates/Module.xctemplate/StoryboardInteractor/___FILEBASENAME___Presenter.swift b/Templates/VIPER Templates/Module.xctemplate/StoryboardInteractor/___FILEBASENAME___Presenter.swift new file mode 100644 index 0000000..51cc5ea --- /dev/null +++ b/Templates/VIPER Templates/Module.xctemplate/StoryboardInteractor/___FILEBASENAME___Presenter.swift @@ -0,0 +1,33 @@ +// +// ___FILENAME___ +// ___PROJECTNAME___ +// +// Created by ___FULLUSERNAME___ on ___DATE___. +// Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. +// +// This file was generated by the 🐍 VIPER generator +// + +import UIKit + +final class ___VARIABLE_moduleName___Presenter { + + // MARK: - Private properties - + + private unowned let view: ___VARIABLE_moduleName___ViewInterface + private let interactor: ___VARIABLE_moduleName___InteractorInterface + private let wireframe: ___VARIABLE_moduleName___WireframeInterface + + // MARK: - Lifecycle - + + init(view: ___VARIABLE_moduleName___ViewInterface, interactor: ___VARIABLE_moduleName___InteractorInterface, wireframe: ___VARIABLE_moduleName___WireframeInterface) { + self.view = view + self.interactor = interactor + self.wireframe = wireframe + } +} + +// MARK: - Extensions - + +extension ___VARIABLE_moduleName___Presenter: ___VARIABLE_moduleName___PresenterInterface { +} diff --git a/Templates/VIPER Templates/Module.xctemplate/StoryboardInteractor/___FILEBASENAME___ViewController.swift b/Templates/VIPER Templates/Module.xctemplate/StoryboardInteractor/___FILEBASENAME___ViewController.swift new file mode 100644 index 0000000..cca6aeb --- /dev/null +++ b/Templates/VIPER Templates/Module.xctemplate/StoryboardInteractor/___FILEBASENAME___ViewController.swift @@ -0,0 +1,30 @@ +// +// ___FILENAME___ +// ___PROJECTNAME___ +// +// Created by ___FULLUSERNAME___ on ___DATE___. +// Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. +// +// This file was generated by the 🐍 VIPER generator +// + +import UIKit + +final class ___VARIABLE_moduleName___ViewController: UIViewController { + + // MARK: - Public properties - + + var presenter: ___VARIABLE_moduleName___PresenterInterface! + + // MARK: - Lifecycle - + + override func viewDidLoad() { + super.viewDidLoad() + } + +} + +// MARK: - Extensions - + +extension ___VARIABLE_moduleName___ViewController: ___VARIABLE_moduleName___ViewInterface { +} diff --git a/VIPER Templates/Module V2.xctemplate/Storyboard/___FILEBASENAME___Wireframe.swift b/Templates/VIPER Templates/Module.xctemplate/StoryboardInteractor/___FILEBASENAME___Wireframe.swift similarity index 62% rename from VIPER Templates/Module V2.xctemplate/Storyboard/___FILEBASENAME___Wireframe.swift rename to Templates/VIPER Templates/Module.xctemplate/StoryboardInteractor/___FILEBASENAME___Wireframe.swift index 5946dc1..8c0a397 100644 --- a/VIPER Templates/Module V2.xctemplate/Storyboard/___FILEBASENAME___Wireframe.swift +++ b/Templates/VIPER Templates/Module.xctemplate/StoryboardInteractor/___FILEBASENAME___Wireframe.swift @@ -14,16 +14,16 @@ final class ___VARIABLE_moduleName___Wireframe: BaseWireframe { // MARK: - Private properties - - private let _storyboard = UIStoryboard(name: "___VARIABLE_moduleName___", bundle: nil) + private let storyboard = UIStoryboard(name: "___VARIABLE_moduleName___", bundle: nil) // MARK: - Module setup - init() { - let moduleViewController = _storyboard.instantiateViewController(ofType: ___VARIABLE_moduleName___ViewController.self) + let moduleViewController = storyboard.instantiateViewController(ofType: ___VARIABLE_moduleName___ViewController.self) super.init(viewController: moduleViewController) let interactor = ___VARIABLE_moduleName___Interactor() - let presenter = ___VARIABLE_moduleName___Presenter(wireframe: self, view: moduleViewController, interactor: interactor) + let presenter = ___VARIABLE_moduleName___Presenter(view: moduleViewController, interactor: interactor, wireframe: self) moduleViewController.presenter = presenter } @@ -32,7 +32,4 @@ final class ___VARIABLE_moduleName___Wireframe: BaseWireframe { // MARK: - Extensions - extension ___VARIABLE_moduleName___Wireframe: ___VARIABLE_moduleName___WireframeInterface { - - func navigate(to option: ___VARIABLE_moduleName___NavigationOption) { - } } diff --git a/Templates/VIPER Templates/Module.xctemplate/StoryboardInteractorAndFormatter/___FILEBASENAME___.storyboard b/Templates/VIPER Templates/Module.xctemplate/StoryboardInteractorAndFormatter/___FILEBASENAME___.storyboard new file mode 100644 index 0000000..121f30b --- /dev/null +++ b/Templates/VIPER Templates/Module.xctemplate/StoryboardInteractorAndFormatter/___FILEBASENAME___.storyboard @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Templates/VIPER Templates/Module.xctemplate/StoryboardInteractorAndFormatter/___FILEBASENAME___Formatter.swift b/Templates/VIPER Templates/Module.xctemplate/StoryboardInteractorAndFormatter/___FILEBASENAME___Formatter.swift new file mode 100644 index 0000000..7ea487f --- /dev/null +++ b/Templates/VIPER Templates/Module.xctemplate/StoryboardInteractorAndFormatter/___FILEBASENAME___Formatter.swift @@ -0,0 +1,19 @@ +// +// ___FILENAME___ +// ___PROJECTNAME___ +// +// Created by ___FULLUSERNAME___ on ___DATE___. +// Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. +// +// This file was generated by the 🐍 VIPER generator +// + +import UIKit + +final class ___VARIABLE_moduleName___Formatter { +} + +// MARK: - Extensions - + +extension ___VARIABLE_moduleName___Formatter: ___VARIABLE_moduleName___FormatterInterface { +} diff --git a/Templates/VIPER Templates/Module.xctemplate/StoryboardInteractorAndFormatter/___FILEBASENAME___Interactor.swift b/Templates/VIPER Templates/Module.xctemplate/StoryboardInteractorAndFormatter/___FILEBASENAME___Interactor.swift new file mode 100644 index 0000000..676cfc1 --- /dev/null +++ b/Templates/VIPER Templates/Module.xctemplate/StoryboardInteractorAndFormatter/___FILEBASENAME___Interactor.swift @@ -0,0 +1,19 @@ +// +// ___FILENAME___ +// ___PROJECTNAME___ +// +// Created by ___FULLUSERNAME___ on ___DATE___. +// Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. +// +// This file was generated by the 🐍 VIPER generator +// + +import Foundation + +final class ___VARIABLE_moduleName___Interactor { +} + +// MARK: - Extensions - + +extension ___VARIABLE_moduleName___Interactor: ___VARIABLE_moduleName___InteractorInterface { +} diff --git a/VIPER Templates/Module V2.xctemplate/Storyboard/___FILEBASENAME___Interfaces.swift b/Templates/VIPER Templates/Module.xctemplate/StoryboardInteractorAndFormatter/___FILEBASENAME___Interfaces.swift similarity index 82% rename from VIPER Templates/Module V2.xctemplate/Storyboard/___FILEBASENAME___Interfaces.swift rename to Templates/VIPER Templates/Module.xctemplate/StoryboardInteractorAndFormatter/___FILEBASENAME___Interfaces.swift index 2fd41a7..a9473d4 100644 --- a/VIPER Templates/Module V2.xctemplate/Storyboard/___FILEBASENAME___Interfaces.swift +++ b/Templates/VIPER Templates/Module.xctemplate/StoryboardInteractorAndFormatter/___FILEBASENAME___Interfaces.swift @@ -10,11 +10,7 @@ import UIKit -enum ___VARIABLE_moduleName___NavigationOption { -} - protocol ___VARIABLE_moduleName___WireframeInterface: WireframeInterface { - func navigate(to option: ___VARIABLE_moduleName___NavigationOption) } protocol ___VARIABLE_moduleName___ViewInterface: ViewInterface { @@ -23,5 +19,8 @@ protocol ___VARIABLE_moduleName___ViewInterface: ViewInterface { protocol ___VARIABLE_moduleName___PresenterInterface: PresenterInterface { } +protocol ___VARIABLE_moduleName___FormatterInterface: FormatterInterface { +} + protocol ___VARIABLE_moduleName___InteractorInterface: InteractorInterface { } diff --git a/Templates/VIPER Templates/Module.xctemplate/StoryboardInteractorAndFormatter/___FILEBASENAME___Presenter.swift b/Templates/VIPER Templates/Module.xctemplate/StoryboardInteractorAndFormatter/___FILEBASENAME___Presenter.swift new file mode 100644 index 0000000..22e31e4 --- /dev/null +++ b/Templates/VIPER Templates/Module.xctemplate/StoryboardInteractorAndFormatter/___FILEBASENAME___Presenter.swift @@ -0,0 +1,35 @@ +// +// ___FILENAME___ +// ___PROJECTNAME___ +// +// Created by ___FULLUSERNAME___ on ___DATE___. +// Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. +// +// This file was generated by the 🐍 VIPER generator +// + +import UIKit + +final class ___VARIABLE_moduleName___Presenter { + + // MARK: - Private properties - + + private unowned let view: ___VARIABLE_moduleName___ViewInterface + private let formatter: ___VARIABLE_moduleName___FormatterInterface + private let interactor: ___VARIABLE_moduleName___InteractorInterface + private let wireframe: ___VARIABLE_moduleName___WireframeInterface + + // MARK: - Lifecycle - + + init(view: ___VARIABLE_moduleName___ViewInterface, formatter: ___VARIABLE_moduleName___FormatterInterface, interactor: ___VARIABLE_moduleName___InteractorInterface, wireframe: ___VARIABLE_moduleName___WireframeInterface) { + self.view = view + self.formatter = formatter + self.interactor = interactor + self.wireframe = wireframe + } +} + +// MARK: - Extensions - + +extension ___VARIABLE_moduleName___Presenter: ___VARIABLE_moduleName___PresenterInterface { +} diff --git a/Templates/VIPER Templates/Module.xctemplate/StoryboardInteractorAndFormatter/___FILEBASENAME___ViewController.swift b/Templates/VIPER Templates/Module.xctemplate/StoryboardInteractorAndFormatter/___FILEBASENAME___ViewController.swift new file mode 100644 index 0000000..cca6aeb --- /dev/null +++ b/Templates/VIPER Templates/Module.xctemplate/StoryboardInteractorAndFormatter/___FILEBASENAME___ViewController.swift @@ -0,0 +1,30 @@ +// +// ___FILENAME___ +// ___PROJECTNAME___ +// +// Created by ___FULLUSERNAME___ on ___DATE___. +// Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. +// +// This file was generated by the 🐍 VIPER generator +// + +import UIKit + +final class ___VARIABLE_moduleName___ViewController: UIViewController { + + // MARK: - Public properties - + + var presenter: ___VARIABLE_moduleName___PresenterInterface! + + // MARK: - Lifecycle - + + override func viewDidLoad() { + super.viewDidLoad() + } + +} + +// MARK: - Extensions - + +extension ___VARIABLE_moduleName___ViewController: ___VARIABLE_moduleName___ViewInterface { +} diff --git a/Templates/VIPER Templates/Module.xctemplate/StoryboardInteractorAndFormatter/___FILEBASENAME___Wireframe.swift b/Templates/VIPER Templates/Module.xctemplate/StoryboardInteractorAndFormatter/___FILEBASENAME___Wireframe.swift new file mode 100644 index 0000000..b3adcd7 --- /dev/null +++ b/Templates/VIPER Templates/Module.xctemplate/StoryboardInteractorAndFormatter/___FILEBASENAME___Wireframe.swift @@ -0,0 +1,36 @@ +// +// ___FILENAME___ +// ___PROJECTNAME___ +// +// Created by ___FULLUSERNAME___ on ___DATE___. +// Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. +// +// This file was generated by the 🐍 VIPER generator +// + +import UIKit + +final class ___VARIABLE_moduleName___Wireframe: BaseWireframe { + + // MARK: - Private properties - + + private let storyboard = UIStoryboard(name: "___VARIABLE_moduleName___", bundle: nil) + + // MARK: - Module setup - + + init() { + let moduleViewController = storyboard.instantiateViewController(ofType: ___VARIABLE_moduleName___ViewController.self) + super.init(viewController: moduleViewController) + + let formatter = ___VARIABLE_moduleName___Formatter() + let interactor = ___VARIABLE_moduleName___Interactor() + let presenter = ___VARIABLE_moduleName___Presenter(view: moduleViewController, formatter: formatter, interactor: interactor, wireframe: self) + moduleViewController.presenter = presenter + } + +} + +// MARK: - Extensions - + +extension ___VARIABLE_moduleName___Wireframe: ___VARIABLE_moduleName___WireframeInterface { +} diff --git a/Templates/VIPER Templates/Module.xctemplate/StoryboardSimple/___FILEBASENAME___.storyboard b/Templates/VIPER Templates/Module.xctemplate/StoryboardSimple/___FILEBASENAME___.storyboard new file mode 100644 index 0000000..121f30b --- /dev/null +++ b/Templates/VIPER Templates/Module.xctemplate/StoryboardSimple/___FILEBASENAME___.storyboard @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Templates/VIPER Templates/Module.xctemplate/StoryboardSimple/___FILEBASENAME___Interfaces.swift b/Templates/VIPER Templates/Module.xctemplate/StoryboardSimple/___FILEBASENAME___Interfaces.swift new file mode 100644 index 0000000..3366117 --- /dev/null +++ b/Templates/VIPER Templates/Module.xctemplate/StoryboardSimple/___FILEBASENAME___Interfaces.swift @@ -0,0 +1,20 @@ +// +// ___FILENAME___ +// ___PROJECTNAME___ +// +// Created by ___FULLUSERNAME___ on ___DATE___. +// Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. +// +// This file was generated by the 🐍 VIPER generator +// + +import UIKit + +protocol ___VARIABLE_moduleName___WireframeInterface: WireframeInterface { +} + +protocol ___VARIABLE_moduleName___ViewInterface: ViewInterface { +} + +protocol ___VARIABLE_moduleName___PresenterInterface: PresenterInterface { +} diff --git a/VIPER Templates/Module V2.xctemplate/Storyboard/___FILEBASENAME___Presenter.swift b/Templates/VIPER Templates/Module.xctemplate/StoryboardSimple/___FILEBASENAME___Presenter.swift similarity index 50% rename from VIPER Templates/Module V2.xctemplate/Storyboard/___FILEBASENAME___Presenter.swift rename to Templates/VIPER Templates/Module.xctemplate/StoryboardSimple/___FILEBASENAME___Presenter.swift index 099a0ab..7995f03 100644 --- a/VIPER Templates/Module V2.xctemplate/Storyboard/___FILEBASENAME___Presenter.swift +++ b/Templates/VIPER Templates/Module.xctemplate/StoryboardSimple/___FILEBASENAME___Presenter.swift @@ -14,16 +14,14 @@ final class ___VARIABLE_moduleName___Presenter { // MARK: - Private properties - - private unowned let _view: ___VARIABLE_moduleName___ViewInterface - private let _wireframe: ___VARIABLE_moduleName___WireframeInterface - private let _interactor: ___VARIABLE_moduleName___InteractorInterface + private unowned let view: ___VARIABLE_moduleName___ViewInterface + private let wireframe: ___VARIABLE_moduleName___WireframeInterface // MARK: - Lifecycle - - init(wireframe: ___VARIABLE_moduleName___WireframeInterface, view: ___VARIABLE_moduleName___ViewInterface, interactor: ___VARIABLE_moduleName___InteractorInterface) { - _wireframe = wireframe - _view = view - _interactor = interactor + init(view: ___VARIABLE_moduleName___ViewInterface, wireframe: ___VARIABLE_moduleName___WireframeInterface) { + self.view = view + self.wireframe = wireframe } } diff --git a/Templates/VIPER Templates/Module.xctemplate/StoryboardSimple/___FILEBASENAME___ViewController.swift b/Templates/VIPER Templates/Module.xctemplate/StoryboardSimple/___FILEBASENAME___ViewController.swift new file mode 100644 index 0000000..cca6aeb --- /dev/null +++ b/Templates/VIPER Templates/Module.xctemplate/StoryboardSimple/___FILEBASENAME___ViewController.swift @@ -0,0 +1,30 @@ +// +// ___FILENAME___ +// ___PROJECTNAME___ +// +// Created by ___FULLUSERNAME___ on ___DATE___. +// Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. +// +// This file was generated by the 🐍 VIPER generator +// + +import UIKit + +final class ___VARIABLE_moduleName___ViewController: UIViewController { + + // MARK: - Public properties - + + var presenter: ___VARIABLE_moduleName___PresenterInterface! + + // MARK: - Lifecycle - + + override func viewDidLoad() { + super.viewDidLoad() + } + +} + +// MARK: - Extensions - + +extension ___VARIABLE_moduleName___ViewController: ___VARIABLE_moduleName___ViewInterface { +} diff --git a/Templates/VIPER Templates/Module.xctemplate/StoryboardSimple/___FILEBASENAME___Wireframe.swift b/Templates/VIPER Templates/Module.xctemplate/StoryboardSimple/___FILEBASENAME___Wireframe.swift new file mode 100644 index 0000000..8ca61c6 --- /dev/null +++ b/Templates/VIPER Templates/Module.xctemplate/StoryboardSimple/___FILEBASENAME___Wireframe.swift @@ -0,0 +1,34 @@ +// +// ___FILENAME___ +// ___PROJECTNAME___ +// +// Created by ___FULLUSERNAME___ on ___DATE___. +// Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. +// +// This file was generated by the 🐍 VIPER generator +// + +import UIKit + +final class ___VARIABLE_moduleName___Wireframe: BaseWireframe { + + // MARK: - Private properties - + + private let storyboard = UIStoryboard(name: "___VARIABLE_moduleName___", bundle: nil) + + // MARK: - Module setup - + + init() { + let moduleViewController = storyboard.instantiateViewController(ofType: ___VARIABLE_moduleName___ViewController.self) + super.init(viewController: moduleViewController) + + let presenter = ___VARIABLE_moduleName___Presenter(view: moduleViewController, wireframe: self) + moduleViewController.presenter = presenter + } + +} + +// MARK: - Extensions - + +extension ___VARIABLE_moduleName___Wireframe: ___VARIABLE_moduleName___WireframeInterface { +} diff --git a/Templates/VIPER Templates/Module.xctemplate/TemplateIcon.png b/Templates/VIPER Templates/Module.xctemplate/TemplateIcon.png new file mode 100644 index 0000000..21ba540 Binary files /dev/null and b/Templates/VIPER Templates/Module.xctemplate/TemplateIcon.png differ diff --git a/Templates/VIPER Templates/Module.xctemplate/TemplateIcon@2x.png b/Templates/VIPER Templates/Module.xctemplate/TemplateIcon@2x.png new file mode 100644 index 0000000..f95e65c Binary files /dev/null and b/Templates/VIPER Templates/Module.xctemplate/TemplateIcon@2x.png differ diff --git a/VIPER Templates/Module V2.xctemplate/TemplateIcon.png b/Templates/VIPER Templates/Module.xctemplate/TemplateIcon@3x.png similarity index 100% rename from VIPER Templates/Module V2.xctemplate/TemplateIcon.png rename to Templates/VIPER Templates/Module.xctemplate/TemplateIcon@3x.png diff --git a/VIPER Templates/Module V2.xctemplate/TemplateInfo.plist b/Templates/VIPER Templates/Module.xctemplate/TemplateInfo.plist similarity index 57% rename from VIPER Templates/Module V2.xctemplate/TemplateInfo.plist rename to Templates/VIPER Templates/Module.xctemplate/TemplateInfo.plist index 1b873b8..e977270 100644 --- a/VIPER Templates/Module V2.xctemplate/TemplateInfo.plist +++ b/Templates/VIPER Templates/Module.xctemplate/TemplateInfo.plist @@ -3,9 +3,9 @@ DefaultCompletionName - MyModule + VIPERModule Description - This generates a new Module using 🐍VIPER generator. It consists of the view controller, interactor, presenter, wireframe, and an interface file. + This generates a new Module using 🐍VIPER generator. Kind Xcode.IDEKit.TextSubstitutionFileTemplateKind Options @@ -34,17 +34,39 @@ Identifier - Storyboard + interface Name - Generate Storyboard with UIViewController + Generate Interface Builder: Description - Generate Storyboard with UIViewController + Which interface builder to generate Type - checkbox + popup Default - false - NotPersisted - + None + Values + + XIB + None + Storyboard + + + + Identifier + complex + Name + Module Complexity: + Description + Type of a module to generate - simple, with interactor, or with interactor and formatter + Type + popup + Default + Interactor + Values + + Simple + Interactor + InteractorAndFormatter + Platforms diff --git a/Templates/VIPER Templates/Module.xctemplate/XIBInteractor/___FILEBASENAME___Interactor.swift b/Templates/VIPER Templates/Module.xctemplate/XIBInteractor/___FILEBASENAME___Interactor.swift new file mode 100644 index 0000000..676cfc1 --- /dev/null +++ b/Templates/VIPER Templates/Module.xctemplate/XIBInteractor/___FILEBASENAME___Interactor.swift @@ -0,0 +1,19 @@ +// +// ___FILENAME___ +// ___PROJECTNAME___ +// +// Created by ___FULLUSERNAME___ on ___DATE___. +// Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. +// +// This file was generated by the 🐍 VIPER generator +// + +import Foundation + +final class ___VARIABLE_moduleName___Interactor { +} + +// MARK: - Extensions - + +extension ___VARIABLE_moduleName___Interactor: ___VARIABLE_moduleName___InteractorInterface { +} diff --git a/Templates/VIPER Templates/Module.xctemplate/XIBInteractor/___FILEBASENAME___Interfaces.swift b/Templates/VIPER Templates/Module.xctemplate/XIBInteractor/___FILEBASENAME___Interfaces.swift new file mode 100644 index 0000000..c3bebb6 --- /dev/null +++ b/Templates/VIPER Templates/Module.xctemplate/XIBInteractor/___FILEBASENAME___Interfaces.swift @@ -0,0 +1,23 @@ +// +// ___FILENAME___ +// ___PROJECTNAME___ +// +// Created by ___FULLUSERNAME___ on ___DATE___. +// Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. +// +// This file was generated by the 🐍 VIPER generator +// + +import UIKit + +protocol ___VARIABLE_moduleName___WireframeInterface: WireframeInterface { +} + +protocol ___VARIABLE_moduleName___ViewInterface: ViewInterface { +} + +protocol ___VARIABLE_moduleName___PresenterInterface: PresenterInterface { +} + +protocol ___VARIABLE_moduleName___InteractorInterface: InteractorInterface { +} diff --git a/Templates/VIPER Templates/Module.xctemplate/XIBInteractor/___FILEBASENAME___Presenter.swift b/Templates/VIPER Templates/Module.xctemplate/XIBInteractor/___FILEBASENAME___Presenter.swift new file mode 100644 index 0000000..51cc5ea --- /dev/null +++ b/Templates/VIPER Templates/Module.xctemplate/XIBInteractor/___FILEBASENAME___Presenter.swift @@ -0,0 +1,33 @@ +// +// ___FILENAME___ +// ___PROJECTNAME___ +// +// Created by ___FULLUSERNAME___ on ___DATE___. +// Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. +// +// This file was generated by the 🐍 VIPER generator +// + +import UIKit + +final class ___VARIABLE_moduleName___Presenter { + + // MARK: - Private properties - + + private unowned let view: ___VARIABLE_moduleName___ViewInterface + private let interactor: ___VARIABLE_moduleName___InteractorInterface + private let wireframe: ___VARIABLE_moduleName___WireframeInterface + + // MARK: - Lifecycle - + + init(view: ___VARIABLE_moduleName___ViewInterface, interactor: ___VARIABLE_moduleName___InteractorInterface, wireframe: ___VARIABLE_moduleName___WireframeInterface) { + self.view = view + self.interactor = interactor + self.wireframe = wireframe + } +} + +// MARK: - Extensions - + +extension ___VARIABLE_moduleName___Presenter: ___VARIABLE_moduleName___PresenterInterface { +} diff --git a/Templates/VIPER Templates/Module.xctemplate/XIBInteractor/___FILEBASENAME___ViewController.swift b/Templates/VIPER Templates/Module.xctemplate/XIBInteractor/___FILEBASENAME___ViewController.swift new file mode 100644 index 0000000..cca6aeb --- /dev/null +++ b/Templates/VIPER Templates/Module.xctemplate/XIBInteractor/___FILEBASENAME___ViewController.swift @@ -0,0 +1,30 @@ +// +// ___FILENAME___ +// ___PROJECTNAME___ +// +// Created by ___FULLUSERNAME___ on ___DATE___. +// Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. +// +// This file was generated by the 🐍 VIPER generator +// + +import UIKit + +final class ___VARIABLE_moduleName___ViewController: UIViewController { + + // MARK: - Public properties - + + var presenter: ___VARIABLE_moduleName___PresenterInterface! + + // MARK: - Lifecycle - + + override func viewDidLoad() { + super.viewDidLoad() + } + +} + +// MARK: - Extensions - + +extension ___VARIABLE_moduleName___ViewController: ___VARIABLE_moduleName___ViewInterface { +} diff --git a/Templates/VIPER Templates/Module.xctemplate/XIBInteractor/___FILEBASENAME___ViewController.xib b/Templates/VIPER Templates/Module.xctemplate/XIBInteractor/___FILEBASENAME___ViewController.xib new file mode 100644 index 0000000..949017e --- /dev/null +++ b/Templates/VIPER Templates/Module.xctemplate/XIBInteractor/___FILEBASENAME___ViewController.xib @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/Templates/VIPER Templates/Module.xctemplate/XIBInteractor/___FILEBASENAME___Wireframe.swift b/Templates/VIPER Templates/Module.xctemplate/XIBInteractor/___FILEBASENAME___Wireframe.swift new file mode 100644 index 0000000..90d64e7 --- /dev/null +++ b/Templates/VIPER Templates/Module.xctemplate/XIBInteractor/___FILEBASENAME___Wireframe.swift @@ -0,0 +1,31 @@ +// +// ___FILENAME___ +// ___PROJECTNAME___ +// +// Created by ___FULLUSERNAME___ on ___DATE___. +// Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. +// +// This file was generated by the 🐍 VIPER generator +// + +import UIKit + +final class ___VARIABLE_moduleName___Wireframe: BaseWireframe { + + // MARK: - Module setup - + + init() { + let moduleViewController = ___VARIABLE_moduleName___ViewController() + super.init(viewController: moduleViewController) + + let interactor = ___VARIABLE_moduleName___Interactor() + let presenter = ___VARIABLE_moduleName___Presenter(view: moduleViewController, interactor: interactor, wireframe: self) + moduleViewController.presenter = presenter + } + +} + +// MARK: - Extensions - + +extension ___VARIABLE_moduleName___Wireframe: ___VARIABLE_moduleName___WireframeInterface { +} diff --git a/Templates/VIPER Templates/Module.xctemplate/XIBInteractorAndFormatter/___FILEBASENAME___Formatter.swift b/Templates/VIPER Templates/Module.xctemplate/XIBInteractorAndFormatter/___FILEBASENAME___Formatter.swift new file mode 100644 index 0000000..7ea487f --- /dev/null +++ b/Templates/VIPER Templates/Module.xctemplate/XIBInteractorAndFormatter/___FILEBASENAME___Formatter.swift @@ -0,0 +1,19 @@ +// +// ___FILENAME___ +// ___PROJECTNAME___ +// +// Created by ___FULLUSERNAME___ on ___DATE___. +// Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. +// +// This file was generated by the 🐍 VIPER generator +// + +import UIKit + +final class ___VARIABLE_moduleName___Formatter { +} + +// MARK: - Extensions - + +extension ___VARIABLE_moduleName___Formatter: ___VARIABLE_moduleName___FormatterInterface { +} diff --git a/Templates/VIPER Templates/Module.xctemplate/XIBInteractorAndFormatter/___FILEBASENAME___Interactor.swift b/Templates/VIPER Templates/Module.xctemplate/XIBInteractorAndFormatter/___FILEBASENAME___Interactor.swift new file mode 100644 index 0000000..676cfc1 --- /dev/null +++ b/Templates/VIPER Templates/Module.xctemplate/XIBInteractorAndFormatter/___FILEBASENAME___Interactor.swift @@ -0,0 +1,19 @@ +// +// ___FILENAME___ +// ___PROJECTNAME___ +// +// Created by ___FULLUSERNAME___ on ___DATE___. +// Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. +// +// This file was generated by the 🐍 VIPER generator +// + +import Foundation + +final class ___VARIABLE_moduleName___Interactor { +} + +// MARK: - Extensions - + +extension ___VARIABLE_moduleName___Interactor: ___VARIABLE_moduleName___InteractorInterface { +} diff --git a/VIPER Templates/Module V1.xctemplate/UIViewController/___FILEBASENAME___Interfaces.swift b/Templates/VIPER Templates/Module.xctemplate/XIBInteractorAndFormatter/___FILEBASENAME___Interfaces.swift old mode 100755 new mode 100644 similarity index 82% rename from VIPER Templates/Module V1.xctemplate/UIViewController/___FILEBASENAME___Interfaces.swift rename to Templates/VIPER Templates/Module.xctemplate/XIBInteractorAndFormatter/___FILEBASENAME___Interfaces.swift index 2fd41a7..a9473d4 --- a/VIPER Templates/Module V1.xctemplate/UIViewController/___FILEBASENAME___Interfaces.swift +++ b/Templates/VIPER Templates/Module.xctemplate/XIBInteractorAndFormatter/___FILEBASENAME___Interfaces.swift @@ -10,11 +10,7 @@ import UIKit -enum ___VARIABLE_moduleName___NavigationOption { -} - protocol ___VARIABLE_moduleName___WireframeInterface: WireframeInterface { - func navigate(to option: ___VARIABLE_moduleName___NavigationOption) } protocol ___VARIABLE_moduleName___ViewInterface: ViewInterface { @@ -23,5 +19,8 @@ protocol ___VARIABLE_moduleName___ViewInterface: ViewInterface { protocol ___VARIABLE_moduleName___PresenterInterface: PresenterInterface { } +protocol ___VARIABLE_moduleName___FormatterInterface: FormatterInterface { +} + protocol ___VARIABLE_moduleName___InteractorInterface: InteractorInterface { } diff --git a/Templates/VIPER Templates/Module.xctemplate/XIBInteractorAndFormatter/___FILEBASENAME___Presenter.swift b/Templates/VIPER Templates/Module.xctemplate/XIBInteractorAndFormatter/___FILEBASENAME___Presenter.swift new file mode 100644 index 0000000..22e31e4 --- /dev/null +++ b/Templates/VIPER Templates/Module.xctemplate/XIBInteractorAndFormatter/___FILEBASENAME___Presenter.swift @@ -0,0 +1,35 @@ +// +// ___FILENAME___ +// ___PROJECTNAME___ +// +// Created by ___FULLUSERNAME___ on ___DATE___. +// Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. +// +// This file was generated by the 🐍 VIPER generator +// + +import UIKit + +final class ___VARIABLE_moduleName___Presenter { + + // MARK: - Private properties - + + private unowned let view: ___VARIABLE_moduleName___ViewInterface + private let formatter: ___VARIABLE_moduleName___FormatterInterface + private let interactor: ___VARIABLE_moduleName___InteractorInterface + private let wireframe: ___VARIABLE_moduleName___WireframeInterface + + // MARK: - Lifecycle - + + init(view: ___VARIABLE_moduleName___ViewInterface, formatter: ___VARIABLE_moduleName___FormatterInterface, interactor: ___VARIABLE_moduleName___InteractorInterface, wireframe: ___VARIABLE_moduleName___WireframeInterface) { + self.view = view + self.formatter = formatter + self.interactor = interactor + self.wireframe = wireframe + } +} + +// MARK: - Extensions - + +extension ___VARIABLE_moduleName___Presenter: ___VARIABLE_moduleName___PresenterInterface { +} diff --git a/Templates/VIPER Templates/Module.xctemplate/XIBInteractorAndFormatter/___FILEBASENAME___ViewController.swift b/Templates/VIPER Templates/Module.xctemplate/XIBInteractorAndFormatter/___FILEBASENAME___ViewController.swift new file mode 100644 index 0000000..cca6aeb --- /dev/null +++ b/Templates/VIPER Templates/Module.xctemplate/XIBInteractorAndFormatter/___FILEBASENAME___ViewController.swift @@ -0,0 +1,30 @@ +// +// ___FILENAME___ +// ___PROJECTNAME___ +// +// Created by ___FULLUSERNAME___ on ___DATE___. +// Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. +// +// This file was generated by the 🐍 VIPER generator +// + +import UIKit + +final class ___VARIABLE_moduleName___ViewController: UIViewController { + + // MARK: - Public properties - + + var presenter: ___VARIABLE_moduleName___PresenterInterface! + + // MARK: - Lifecycle - + + override func viewDidLoad() { + super.viewDidLoad() + } + +} + +// MARK: - Extensions - + +extension ___VARIABLE_moduleName___ViewController: ___VARIABLE_moduleName___ViewInterface { +} diff --git a/Templates/VIPER Templates/Module.xctemplate/XIBInteractorAndFormatter/___FILEBASENAME___ViewController.xib b/Templates/VIPER Templates/Module.xctemplate/XIBInteractorAndFormatter/___FILEBASENAME___ViewController.xib new file mode 100644 index 0000000..949017e --- /dev/null +++ b/Templates/VIPER Templates/Module.xctemplate/XIBInteractorAndFormatter/___FILEBASENAME___ViewController.xib @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/Templates/VIPER Templates/Module.xctemplate/XIBInteractorAndFormatter/___FILEBASENAME___Wireframe.swift b/Templates/VIPER Templates/Module.xctemplate/XIBInteractorAndFormatter/___FILEBASENAME___Wireframe.swift new file mode 100644 index 0000000..2641d56 --- /dev/null +++ b/Templates/VIPER Templates/Module.xctemplate/XIBInteractorAndFormatter/___FILEBASENAME___Wireframe.swift @@ -0,0 +1,32 @@ +// +// ___FILENAME___ +// ___PROJECTNAME___ +// +// Created by ___FULLUSERNAME___ on ___DATE___. +// Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. +// +// This file was generated by the 🐍 VIPER generator +// + +import UIKit + +final class ___VARIABLE_moduleName___Wireframe: BaseWireframe { + + // MARK: - Module setup - + + init() { + let moduleViewController = ___VARIABLE_moduleName___ViewController() + super.init(viewController: moduleViewController) + + let formatter = ___VARIABLE_moduleName___Formatter() + let interactor = ___VARIABLE_moduleName___Interactor() + let presenter = ___VARIABLE_moduleName___Presenter(view: moduleViewController, formatter: formatter, interactor: interactor, wireframe: self) + moduleViewController.presenter = presenter + } + +} + +// MARK: - Extensions - + +extension ___VARIABLE_moduleName___Wireframe: ___VARIABLE_moduleName___WireframeInterface { +} diff --git a/Templates/VIPER Templates/Module.xctemplate/XIBSimple/___FILEBASENAME___Interfaces.swift b/Templates/VIPER Templates/Module.xctemplate/XIBSimple/___FILEBASENAME___Interfaces.swift new file mode 100644 index 0000000..3366117 --- /dev/null +++ b/Templates/VIPER Templates/Module.xctemplate/XIBSimple/___FILEBASENAME___Interfaces.swift @@ -0,0 +1,20 @@ +// +// ___FILENAME___ +// ___PROJECTNAME___ +// +// Created by ___FULLUSERNAME___ on ___DATE___. +// Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. +// +// This file was generated by the 🐍 VIPER generator +// + +import UIKit + +protocol ___VARIABLE_moduleName___WireframeInterface: WireframeInterface { +} + +protocol ___VARIABLE_moduleName___ViewInterface: ViewInterface { +} + +protocol ___VARIABLE_moduleName___PresenterInterface: PresenterInterface { +} diff --git a/Templates/VIPER Templates/Module.xctemplate/XIBSimple/___FILEBASENAME___Presenter.swift b/Templates/VIPER Templates/Module.xctemplate/XIBSimple/___FILEBASENAME___Presenter.swift new file mode 100644 index 0000000..7995f03 --- /dev/null +++ b/Templates/VIPER Templates/Module.xctemplate/XIBSimple/___FILEBASENAME___Presenter.swift @@ -0,0 +1,31 @@ +// +// ___FILENAME___ +// ___PROJECTNAME___ +// +// Created by ___FULLUSERNAME___ on ___DATE___. +// Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. +// +// This file was generated by the 🐍 VIPER generator +// + +import UIKit + +final class ___VARIABLE_moduleName___Presenter { + + // MARK: - Private properties - + + private unowned let view: ___VARIABLE_moduleName___ViewInterface + private let wireframe: ___VARIABLE_moduleName___WireframeInterface + + // MARK: - Lifecycle - + + init(view: ___VARIABLE_moduleName___ViewInterface, wireframe: ___VARIABLE_moduleName___WireframeInterface) { + self.view = view + self.wireframe = wireframe + } +} + +// MARK: - Extensions - + +extension ___VARIABLE_moduleName___Presenter: ___VARIABLE_moduleName___PresenterInterface { +} diff --git a/Templates/VIPER Templates/Module.xctemplate/XIBSimple/___FILEBASENAME___ViewController.swift b/Templates/VIPER Templates/Module.xctemplate/XIBSimple/___FILEBASENAME___ViewController.swift new file mode 100644 index 0000000..cca6aeb --- /dev/null +++ b/Templates/VIPER Templates/Module.xctemplate/XIBSimple/___FILEBASENAME___ViewController.swift @@ -0,0 +1,30 @@ +// +// ___FILENAME___ +// ___PROJECTNAME___ +// +// Created by ___FULLUSERNAME___ on ___DATE___. +// Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. +// +// This file was generated by the 🐍 VIPER generator +// + +import UIKit + +final class ___VARIABLE_moduleName___ViewController: UIViewController { + + // MARK: - Public properties - + + var presenter: ___VARIABLE_moduleName___PresenterInterface! + + // MARK: - Lifecycle - + + override func viewDidLoad() { + super.viewDidLoad() + } + +} + +// MARK: - Extensions - + +extension ___VARIABLE_moduleName___ViewController: ___VARIABLE_moduleName___ViewInterface { +} diff --git a/Templates/VIPER Templates/Module.xctemplate/XIBSimple/___FILEBASENAME___ViewController.xib b/Templates/VIPER Templates/Module.xctemplate/XIBSimple/___FILEBASENAME___ViewController.xib new file mode 100644 index 0000000..949017e --- /dev/null +++ b/Templates/VIPER Templates/Module.xctemplate/XIBSimple/___FILEBASENAME___ViewController.xib @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/Templates/VIPER Templates/Module.xctemplate/XIBSimple/___FILEBASENAME___Wireframe.swift b/Templates/VIPER Templates/Module.xctemplate/XIBSimple/___FILEBASENAME___Wireframe.swift new file mode 100644 index 0000000..3ae8d98 --- /dev/null +++ b/Templates/VIPER Templates/Module.xctemplate/XIBSimple/___FILEBASENAME___Wireframe.swift @@ -0,0 +1,30 @@ +// +// ___FILENAME___ +// ___PROJECTNAME___ +// +// Created by ___FULLUSERNAME___ on ___DATE___. +// Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. +// +// This file was generated by the 🐍 VIPER generator +// + +import UIKit + +final class ___VARIABLE_moduleName___Wireframe: BaseWireframe { + + // MARK: - Module setup - + + init() { + let moduleViewController = ___VARIABLE_moduleName___ViewController() + super.init(viewController: moduleViewController) + + let presenter = ___VARIABLE_moduleName___Presenter(view: moduleViewController, wireframe: self) + moduleViewController.presenter = presenter + } + +} + +// MARK: - Extensions - + +extension ___VARIABLE_moduleName___Wireframe: ___VARIABLE_moduleName___WireframeInterface { +} diff --git a/Templates/VIPER Templates/RxModule.xctemplate/NoneInteractor/___FILEBASENAME___Interactor.swift b/Templates/VIPER Templates/RxModule.xctemplate/NoneInteractor/___FILEBASENAME___Interactor.swift new file mode 100644 index 0000000..02d9dba --- /dev/null +++ b/Templates/VIPER Templates/RxModule.xctemplate/NoneInteractor/___FILEBASENAME___Interactor.swift @@ -0,0 +1,20 @@ +// +// ___FILENAME___ +// ___PROJECTNAME___ +// +// Created by ___FULLUSERNAME___ on ___DATE___. +// Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. +// +// This file was generated by the 🐍 VIPER generator +// + +import Foundation +import RxSwift + +final class ___VARIABLE_moduleName___Interactor { +} + +// MARK: - Extensions - + +extension ___VARIABLE_moduleName___Interactor: ___VARIABLE_moduleName___InteractorInterface { +} diff --git a/Templates/VIPER Templates/RxModule.xctemplate/NoneInteractor/___FILEBASENAME___Interfaces.swift b/Templates/VIPER Templates/RxModule.xctemplate/NoneInteractor/___FILEBASENAME___Interfaces.swift new file mode 100644 index 0000000..53cf848 --- /dev/null +++ b/Templates/VIPER Templates/RxModule.xctemplate/NoneInteractor/___FILEBASENAME___Interfaces.swift @@ -0,0 +1,36 @@ +// +// ___FILENAME___ +// ___PROJECTNAME___ +// +// Created by ___FULLUSERNAME___ on ___DATE___. +// Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. +// +// This file was generated by the 🐍 VIPER generator +// + +import UIKit +import RxSwift +import RxCocoa + +enum ___VARIABLE_moduleName___ { + + struct ViewOutput { + } + + struct ViewInput { + } + +} + +protocol ___VARIABLE_moduleName___WireframeInterface: WireframeInterface { +} + +protocol ___VARIABLE_moduleName___ViewInterface: ViewInterface { +} + +protocol ___VARIABLE_moduleName___PresenterInterface: PresenterInterface { + func configure(with output: ___VARIABLE_moduleName___.ViewOutput) -> ___VARIABLE_moduleName___.ViewInput +} + +protocol ___VARIABLE_moduleName___InteractorInterface: InteractorInterface { +} diff --git a/Templates/VIPER Templates/RxModule.xctemplate/NoneInteractor/___FILEBASENAME___Presenter.swift b/Templates/VIPER Templates/RxModule.xctemplate/NoneInteractor/___FILEBASENAME___Presenter.swift new file mode 100644 index 0000000..5f2e521 --- /dev/null +++ b/Templates/VIPER Templates/RxModule.xctemplate/NoneInteractor/___FILEBASENAME___Presenter.swift @@ -0,0 +1,40 @@ +// +// ___FILENAME___ +// ___PROJECTNAME___ +// +// Created by ___FULLUSERNAME___ on ___DATE___. +// Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. +// +// This file was generated by the 🐍 VIPER generator +// + +import UIKit +import RxSwift +import RxCocoa + +final class ___VARIABLE_moduleName___Presenter { + + // MARK: - Private properties - + + private unowned let view: ___VARIABLE_moduleName___ViewInterface + private let interactor: ___VARIABLE_moduleName___InteractorInterface + private let wireframe: ___VARIABLE_moduleName___WireframeInterface + + // MARK: - Lifecycle - + + init(view: ___VARIABLE_moduleName___ViewInterface, interactor: ___VARIABLE_moduleName___InteractorInterface, wireframe: ___VARIABLE_moduleName___WireframeInterface) { + self.view = view + self.interactor = interactor + self.wireframe = wireframe + } +} + +// MARK: - Extensions - + +extension ___VARIABLE_moduleName___Presenter: ___VARIABLE_moduleName___PresenterInterface { + + func configure(with output: ___VARIABLE_moduleName___.ViewOutput) -> ___VARIABLE_moduleName___.ViewInput { + return ___VARIABLE_moduleName___.ViewInput() + } + +} diff --git a/Templates/VIPER Templates/RxModule.xctemplate/NoneInteractor/___FILEBASENAME___ViewController.swift b/Templates/VIPER Templates/RxModule.xctemplate/NoneInteractor/___FILEBASENAME___ViewController.swift new file mode 100644 index 0000000..a38cc70 --- /dev/null +++ b/Templates/VIPER Templates/RxModule.xctemplate/NoneInteractor/___FILEBASENAME___ViewController.swift @@ -0,0 +1,47 @@ +// +// ___FILENAME___ +// ___PROJECTNAME___ +// +// Created by ___FULLUSERNAME___ on ___DATE___. +// Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. +// +// This file was generated by the 🐍 VIPER generator +// + +import UIKit +import RxSwift +import RxCocoa + +final class ___VARIABLE_moduleName___ViewController: UIViewController { + + // MARK: - Public properties - + + var presenter: ___VARIABLE_moduleName___PresenterInterface! + + // MARK: - Private properties - + + private let disposeBag = DisposeBag() + + // MARK: - Lifecycle - + + override func viewDidLoad() { + super.viewDidLoad() + configure() + } + +} + +// MARK: - Extensions - + +extension ___VARIABLE_moduleName___ViewController: ___VARIABLE_moduleName___ViewInterface { +} + +private extension ___VARIABLE_moduleName___ViewController { + + func configure() { + let output = ___VARIABLE_moduleName___.ViewOutput() + + let input = presenter.configure(with: output) + } + +} diff --git a/Templates/VIPER Templates/RxModule.xctemplate/NoneInteractor/___FILEBASENAME___Wireframe.swift b/Templates/VIPER Templates/RxModule.xctemplate/NoneInteractor/___FILEBASENAME___Wireframe.swift new file mode 100644 index 0000000..c2c0462 --- /dev/null +++ b/Templates/VIPER Templates/RxModule.xctemplate/NoneInteractor/___FILEBASENAME___Wireframe.swift @@ -0,0 +1,37 @@ +// +// ___FILENAME___ +// ___PROJECTNAME___ +// +// Created by ___FULLUSERNAME___ on ___DATE___. +// Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. +// +// This file was generated by the 🐍 VIPER generator +// + +import UIKit +import RxSwift +import RxCocoa + +final class ___VARIABLE_moduleName___Wireframe: BaseWireframe { + + // MARK: - Private properties - + + private let storyboard = UIStoryboard(name: "<#___VARIABLE_moduleName___#>", bundle: nil) + + // MARK: - Module setup - + + init() { + let moduleViewController = storyboard.instantiateViewController(ofType: ___VARIABLE_moduleName___ViewController.self) + super.init(viewController: moduleViewController) + + let interactor = ___VARIABLE_moduleName___Interactor() + let presenter = ___VARIABLE_moduleName___Presenter(view: moduleViewController, interactor: interactor, wireframe: self) + moduleViewController.presenter = presenter + } + +} + +// MARK: - Extensions - + +extension ___VARIABLE_moduleName___Wireframe: ___VARIABLE_moduleName___WireframeInterface { +} diff --git a/Templates/VIPER Templates/RxModule.xctemplate/NoneInteractorAndFormatter/___FILEBASENAME___Formatter.swift b/Templates/VIPER Templates/RxModule.xctemplate/NoneInteractorAndFormatter/___FILEBASENAME___Formatter.swift new file mode 100644 index 0000000..7e26c0b --- /dev/null +++ b/Templates/VIPER Templates/RxModule.xctemplate/NoneInteractorAndFormatter/___FILEBASENAME___Formatter.swift @@ -0,0 +1,26 @@ +// +// ___FILENAME___ +// ___PROJECTNAME___ +// +// Created by ___FULLUSERNAME___ on ___DATE___. +// Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. +// +// This file was generated by the 🐍 VIPER generator +// + +import UIKit +import RxSwift +import RxCocoa + +final class ___VARIABLE_moduleName___Formatter { +} + +// MARK: - Extensions - + +extension ___VARIABLE_moduleName___Formatter: ___VARIABLE_moduleName___FormatterInterface { + + func format(for input: ___VARIABLE_moduleName___.FormatterInput) -> ___VARIABLE_moduleName___.FormatterOutput { + return ___VARIABLE_moduleName___.FormatterOutput() + } + +} diff --git a/Templates/VIPER Templates/RxModule.xctemplate/NoneInteractorAndFormatter/___FILEBASENAME___Interactor.swift b/Templates/VIPER Templates/RxModule.xctemplate/NoneInteractorAndFormatter/___FILEBASENAME___Interactor.swift new file mode 100644 index 0000000..02d9dba --- /dev/null +++ b/Templates/VIPER Templates/RxModule.xctemplate/NoneInteractorAndFormatter/___FILEBASENAME___Interactor.swift @@ -0,0 +1,20 @@ +// +// ___FILENAME___ +// ___PROJECTNAME___ +// +// Created by ___FULLUSERNAME___ on ___DATE___. +// Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. +// +// This file was generated by the 🐍 VIPER generator +// + +import Foundation +import RxSwift + +final class ___VARIABLE_moduleName___Interactor { +} + +// MARK: - Extensions - + +extension ___VARIABLE_moduleName___Interactor: ___VARIABLE_moduleName___InteractorInterface { +} diff --git a/Templates/VIPER Templates/RxModule.xctemplate/NoneInteractorAndFormatter/___FILEBASENAME___Interfaces.swift b/Templates/VIPER Templates/RxModule.xctemplate/NoneInteractorAndFormatter/___FILEBASENAME___Interfaces.swift new file mode 100644 index 0000000..32c388a --- /dev/null +++ b/Templates/VIPER Templates/RxModule.xctemplate/NoneInteractorAndFormatter/___FILEBASENAME___Interfaces.swift @@ -0,0 +1,47 @@ +// +// ___FILENAME___ +// ___PROJECTNAME___ +// +// Created by ___FULLUSERNAME___ on ___DATE___. +// Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. +// +// This file was generated by the 🐍 VIPER generator +// + +import UIKit +import RxSwift +import RxCocoa + +enum ___VARIABLE_moduleName___ { + + struct ViewOutput { + } + + struct ViewInput { + let models: FormatterOutput + } + + struct FormatterInput { + } + + struct FormatterOutput { + } + +} + +protocol ___VARIABLE_moduleName___WireframeInterface: WireframeInterface { +} + +protocol ___VARIABLE_moduleName___ViewInterface: ViewInterface { +} + +protocol ___VARIABLE_moduleName___PresenterInterface: PresenterInterface { + func configure(with output: ___VARIABLE_moduleName___.ViewOutput) -> ___VARIABLE_moduleName___.ViewInput +} + +protocol ___VARIABLE_moduleName___FormatterInterface: FormatterInterface { + func format(for input: ___VARIABLE_moduleName___.FormatterInput) -> ___VARIABLE_moduleName___.FormatterOutput +} + +protocol ___VARIABLE_moduleName___InteractorInterface: InteractorInterface { +} diff --git a/Templates/VIPER Templates/RxModule.xctemplate/NoneInteractorAndFormatter/___FILEBASENAME___Presenter.swift b/Templates/VIPER Templates/RxModule.xctemplate/NoneInteractorAndFormatter/___FILEBASENAME___Presenter.swift new file mode 100644 index 0000000..24e2354 --- /dev/null +++ b/Templates/VIPER Templates/RxModule.xctemplate/NoneInteractorAndFormatter/___FILEBASENAME___Presenter.swift @@ -0,0 +1,47 @@ +// +// ___FILENAME___ +// ___PROJECTNAME___ +// +// Created by ___FULLUSERNAME___ on ___DATE___. +// Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. +// +// This file was generated by the 🐍 VIPER generator +// + +import UIKit +import RxSwift +import RxCocoa + +final class ___VARIABLE_moduleName___Presenter { + + // MARK: - Private properties - + + private unowned let view: ___VARIABLE_moduleName___ViewInterface + private let formatter: ___VARIABLE_moduleName___FormatterInterface + private let interactor: ___VARIABLE_moduleName___InteractorInterface + private let wireframe: ___VARIABLE_moduleName___WireframeInterface + + // MARK: - Lifecycle - + + init(view: ___VARIABLE_moduleName___ViewInterface, formatter: ___VARIABLE_moduleName___FormatterInterface, interactor: ___VARIABLE_moduleName___InteractorInterface, wireframe: ___VARIABLE_moduleName___WireframeInterface) { + self.view = view + self.formatter = formatter + self.interactor = interactor + self.wireframe = wireframe + } +} + +// MARK: - Extensions - + +extension ___VARIABLE_moduleName___Presenter: ___VARIABLE_moduleName___PresenterInterface { + + func configure(with output: ___VARIABLE_moduleName___.ViewOutput) -> ___VARIABLE_moduleName___.ViewInput { + + let formatterInput = ___VARIABLE_moduleName___.FormatterInput() + + let formatterOutput = formatter.format(for: formatterInput) + + return ___VARIABLE_moduleName___.ViewInput(models: formatterOutput) + } + +} diff --git a/Templates/VIPER Templates/RxModule.xctemplate/NoneInteractorAndFormatter/___FILEBASENAME___ViewController.swift b/Templates/VIPER Templates/RxModule.xctemplate/NoneInteractorAndFormatter/___FILEBASENAME___ViewController.swift new file mode 100644 index 0000000..a38cc70 --- /dev/null +++ b/Templates/VIPER Templates/RxModule.xctemplate/NoneInteractorAndFormatter/___FILEBASENAME___ViewController.swift @@ -0,0 +1,47 @@ +// +// ___FILENAME___ +// ___PROJECTNAME___ +// +// Created by ___FULLUSERNAME___ on ___DATE___. +// Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. +// +// This file was generated by the 🐍 VIPER generator +// + +import UIKit +import RxSwift +import RxCocoa + +final class ___VARIABLE_moduleName___ViewController: UIViewController { + + // MARK: - Public properties - + + var presenter: ___VARIABLE_moduleName___PresenterInterface! + + // MARK: - Private properties - + + private let disposeBag = DisposeBag() + + // MARK: - Lifecycle - + + override func viewDidLoad() { + super.viewDidLoad() + configure() + } + +} + +// MARK: - Extensions - + +extension ___VARIABLE_moduleName___ViewController: ___VARIABLE_moduleName___ViewInterface { +} + +private extension ___VARIABLE_moduleName___ViewController { + + func configure() { + let output = ___VARIABLE_moduleName___.ViewOutput() + + let input = presenter.configure(with: output) + } + +} diff --git a/Templates/VIPER Templates/RxModule.xctemplate/NoneInteractorAndFormatter/___FILEBASENAME___Wireframe.swift b/Templates/VIPER Templates/RxModule.xctemplate/NoneInteractorAndFormatter/___FILEBASENAME___Wireframe.swift new file mode 100644 index 0000000..2bebcec --- /dev/null +++ b/Templates/VIPER Templates/RxModule.xctemplate/NoneInteractorAndFormatter/___FILEBASENAME___Wireframe.swift @@ -0,0 +1,38 @@ +// +// ___FILENAME___ +// ___PROJECTNAME___ +// +// Created by ___FULLUSERNAME___ on ___DATE___. +// Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. +// +// This file was generated by the 🐍 VIPER generator +// + +import UIKit +import RxSwift +import RxCocoa + +final class ___VARIABLE_moduleName___Wireframe: BaseWireframe { + + // MARK: - Private properties - + + private let storyboard = UIStoryboard(name: "<#___VARIABLE_moduleName___#>", bundle: nil) + + // MARK: - Module setup - + + init() { + let moduleViewController = storyboard.instantiateViewController(ofType: ___VARIABLE_moduleName___ViewController.self) + super.init(viewController: moduleViewController) + + let formatter = ___VARIABLE_moduleName___Formatter() + let interactor = ___VARIABLE_moduleName___Interactor() + let presenter = ___VARIABLE_moduleName___Presenter(view: moduleViewController, formatter: formatter, interactor: interactor, wireframe: self) + moduleViewController.presenter = presenter + } + +} + +// MARK: - Extensions - + +extension ___VARIABLE_moduleName___Wireframe: ___VARIABLE_moduleName___WireframeInterface { +} diff --git a/Templates/VIPER Templates/RxModule.xctemplate/NoneSimple/___FILEBASENAME___Interfaces.swift b/Templates/VIPER Templates/RxModule.xctemplate/NoneSimple/___FILEBASENAME___Interfaces.swift new file mode 100644 index 0000000..4b9643e --- /dev/null +++ b/Templates/VIPER Templates/RxModule.xctemplate/NoneSimple/___FILEBASENAME___Interfaces.swift @@ -0,0 +1,33 @@ +// +// ___FILENAME___ +// ___PROJECTNAME___ +// +// Created by ___FULLUSERNAME___ on ___DATE___. +// Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. +// +// This file was generated by the 🐍 VIPER generator +// + +import UIKit +import RxSwift +import RxCocoa + +enum ___VARIABLE_moduleName___ { + + struct ViewOutput { + } + + struct ViewInput { + } + +} + +protocol ___VARIABLE_moduleName___WireframeInterface: WireframeInterface { +} + +protocol ___VARIABLE_moduleName___ViewInterface: ViewInterface { +} + +protocol ___VARIABLE_moduleName___PresenterInterface: PresenterInterface { + func configure(with output: ___VARIABLE_moduleName___.ViewOutput) -> ___VARIABLE_moduleName___.ViewInput +} diff --git a/Templates/VIPER Templates/RxModule.xctemplate/NoneSimple/___FILEBASENAME___Presenter.swift b/Templates/VIPER Templates/RxModule.xctemplate/NoneSimple/___FILEBASENAME___Presenter.swift new file mode 100644 index 0000000..44562eb --- /dev/null +++ b/Templates/VIPER Templates/RxModule.xctemplate/NoneSimple/___FILEBASENAME___Presenter.swift @@ -0,0 +1,38 @@ +// +// ___FILENAME___ +// ___PROJECTNAME___ +// +// Created by ___FULLUSERNAME___ on ___DATE___. +// Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. +// +// This file was generated by the 🐍 VIPER generator +// + +import UIKit +import RxSwift +import RxCocoa + +final class ___VARIABLE_moduleName___Presenter { + + // MARK: - Private properties - + + private unowned let view: ___VARIABLE_moduleName___ViewInterface + private let wireframe: ___VARIABLE_moduleName___WireframeInterface + + // MARK: - Lifecycle - + + init(view: ___VARIABLE_moduleName___ViewInterface, wireframe: ___VARIABLE_moduleName___WireframeInterface) { + self.view = view + self.wireframe = wireframe + } +} + +// MARK: - Extensions - + +extension ___VARIABLE_moduleName___Presenter: ___VARIABLE_moduleName___PresenterInterface { + + func configure(with output: ___VARIABLE_moduleName___.ViewOutput) -> ___VARIABLE_moduleName___.ViewInput { + return ___VARIABLE_moduleName___.ViewInput() + } + +} diff --git a/Templates/VIPER Templates/RxModule.xctemplate/NoneSimple/___FILEBASENAME___ViewController.swift b/Templates/VIPER Templates/RxModule.xctemplate/NoneSimple/___FILEBASENAME___ViewController.swift new file mode 100644 index 0000000..a38cc70 --- /dev/null +++ b/Templates/VIPER Templates/RxModule.xctemplate/NoneSimple/___FILEBASENAME___ViewController.swift @@ -0,0 +1,47 @@ +// +// ___FILENAME___ +// ___PROJECTNAME___ +// +// Created by ___FULLUSERNAME___ on ___DATE___. +// Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. +// +// This file was generated by the 🐍 VIPER generator +// + +import UIKit +import RxSwift +import RxCocoa + +final class ___VARIABLE_moduleName___ViewController: UIViewController { + + // MARK: - Public properties - + + var presenter: ___VARIABLE_moduleName___PresenterInterface! + + // MARK: - Private properties - + + private let disposeBag = DisposeBag() + + // MARK: - Lifecycle - + + override func viewDidLoad() { + super.viewDidLoad() + configure() + } + +} + +// MARK: - Extensions - + +extension ___VARIABLE_moduleName___ViewController: ___VARIABLE_moduleName___ViewInterface { +} + +private extension ___VARIABLE_moduleName___ViewController { + + func configure() { + let output = ___VARIABLE_moduleName___.ViewOutput() + + let input = presenter.configure(with: output) + } + +} diff --git a/Templates/VIPER Templates/RxModule.xctemplate/NoneSimple/___FILEBASENAME___Wireframe.swift b/Templates/VIPER Templates/RxModule.xctemplate/NoneSimple/___FILEBASENAME___Wireframe.swift new file mode 100644 index 0000000..8ffc9e9 --- /dev/null +++ b/Templates/VIPER Templates/RxModule.xctemplate/NoneSimple/___FILEBASENAME___Wireframe.swift @@ -0,0 +1,36 @@ +// +// ___FILENAME___ +// ___PROJECTNAME___ +// +// Created by ___FULLUSERNAME___ on ___DATE___. +// Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. +// +// This file was generated by the 🐍 VIPER generator +// + +import UIKit +import RxSwift +import RxCocoa + +final class ___VARIABLE_moduleName___Wireframe: BaseWireframe { + + // MARK: - Private properties - + + private let storyboard = UIStoryboard(name: "<#___VARIABLE_moduleName___#>", bundle: nil) + + // MARK: - Module setup - + + init() { + let moduleViewController = storyboard.instantiateViewController(ofType: ___VARIABLE_moduleName___ViewController.self) + super.init(viewController: moduleViewController) + + let presenter = ___VARIABLE_moduleName___Presenter(view: moduleViewController, wireframe: self) + moduleViewController.presenter = presenter + } + +} + +// MARK: - Extensions - + +extension ___VARIABLE_moduleName___Wireframe: ___VARIABLE_moduleName___WireframeInterface { +} diff --git a/Templates/VIPER Templates/RxModule.xctemplate/StoryboardInteractor/___FILEBASENAME___.storyboard b/Templates/VIPER Templates/RxModule.xctemplate/StoryboardInteractor/___FILEBASENAME___.storyboard new file mode 100644 index 0000000..121f30b --- /dev/null +++ b/Templates/VIPER Templates/RxModule.xctemplate/StoryboardInteractor/___FILEBASENAME___.storyboard @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Templates/VIPER Templates/RxModule.xctemplate/StoryboardInteractor/___FILEBASENAME___Interactor.swift b/Templates/VIPER Templates/RxModule.xctemplate/StoryboardInteractor/___FILEBASENAME___Interactor.swift new file mode 100644 index 0000000..02d9dba --- /dev/null +++ b/Templates/VIPER Templates/RxModule.xctemplate/StoryboardInteractor/___FILEBASENAME___Interactor.swift @@ -0,0 +1,20 @@ +// +// ___FILENAME___ +// ___PROJECTNAME___ +// +// Created by ___FULLUSERNAME___ on ___DATE___. +// Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. +// +// This file was generated by the 🐍 VIPER generator +// + +import Foundation +import RxSwift + +final class ___VARIABLE_moduleName___Interactor { +} + +// MARK: - Extensions - + +extension ___VARIABLE_moduleName___Interactor: ___VARIABLE_moduleName___InteractorInterface { +} diff --git a/Templates/VIPER Templates/RxModule.xctemplate/StoryboardInteractor/___FILEBASENAME___Interfaces.swift b/Templates/VIPER Templates/RxModule.xctemplate/StoryboardInteractor/___FILEBASENAME___Interfaces.swift new file mode 100644 index 0000000..53cf848 --- /dev/null +++ b/Templates/VIPER Templates/RxModule.xctemplate/StoryboardInteractor/___FILEBASENAME___Interfaces.swift @@ -0,0 +1,36 @@ +// +// ___FILENAME___ +// ___PROJECTNAME___ +// +// Created by ___FULLUSERNAME___ on ___DATE___. +// Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. +// +// This file was generated by the 🐍 VIPER generator +// + +import UIKit +import RxSwift +import RxCocoa + +enum ___VARIABLE_moduleName___ { + + struct ViewOutput { + } + + struct ViewInput { + } + +} + +protocol ___VARIABLE_moduleName___WireframeInterface: WireframeInterface { +} + +protocol ___VARIABLE_moduleName___ViewInterface: ViewInterface { +} + +protocol ___VARIABLE_moduleName___PresenterInterface: PresenterInterface { + func configure(with output: ___VARIABLE_moduleName___.ViewOutput) -> ___VARIABLE_moduleName___.ViewInput +} + +protocol ___VARIABLE_moduleName___InteractorInterface: InteractorInterface { +} diff --git a/Templates/VIPER Templates/RxModule.xctemplate/StoryboardInteractor/___FILEBASENAME___Presenter.swift b/Templates/VIPER Templates/RxModule.xctemplate/StoryboardInteractor/___FILEBASENAME___Presenter.swift new file mode 100644 index 0000000..5f2e521 --- /dev/null +++ b/Templates/VIPER Templates/RxModule.xctemplate/StoryboardInteractor/___FILEBASENAME___Presenter.swift @@ -0,0 +1,40 @@ +// +// ___FILENAME___ +// ___PROJECTNAME___ +// +// Created by ___FULLUSERNAME___ on ___DATE___. +// Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. +// +// This file was generated by the 🐍 VIPER generator +// + +import UIKit +import RxSwift +import RxCocoa + +final class ___VARIABLE_moduleName___Presenter { + + // MARK: - Private properties - + + private unowned let view: ___VARIABLE_moduleName___ViewInterface + private let interactor: ___VARIABLE_moduleName___InteractorInterface + private let wireframe: ___VARIABLE_moduleName___WireframeInterface + + // MARK: - Lifecycle - + + init(view: ___VARIABLE_moduleName___ViewInterface, interactor: ___VARIABLE_moduleName___InteractorInterface, wireframe: ___VARIABLE_moduleName___WireframeInterface) { + self.view = view + self.interactor = interactor + self.wireframe = wireframe + } +} + +// MARK: - Extensions - + +extension ___VARIABLE_moduleName___Presenter: ___VARIABLE_moduleName___PresenterInterface { + + func configure(with output: ___VARIABLE_moduleName___.ViewOutput) -> ___VARIABLE_moduleName___.ViewInput { + return ___VARIABLE_moduleName___.ViewInput() + } + +} diff --git a/Templates/VIPER Templates/RxModule.xctemplate/StoryboardInteractor/___FILEBASENAME___ViewController.swift b/Templates/VIPER Templates/RxModule.xctemplate/StoryboardInteractor/___FILEBASENAME___ViewController.swift new file mode 100644 index 0000000..a38cc70 --- /dev/null +++ b/Templates/VIPER Templates/RxModule.xctemplate/StoryboardInteractor/___FILEBASENAME___ViewController.swift @@ -0,0 +1,47 @@ +// +// ___FILENAME___ +// ___PROJECTNAME___ +// +// Created by ___FULLUSERNAME___ on ___DATE___. +// Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. +// +// This file was generated by the 🐍 VIPER generator +// + +import UIKit +import RxSwift +import RxCocoa + +final class ___VARIABLE_moduleName___ViewController: UIViewController { + + // MARK: - Public properties - + + var presenter: ___VARIABLE_moduleName___PresenterInterface! + + // MARK: - Private properties - + + private let disposeBag = DisposeBag() + + // MARK: - Lifecycle - + + override func viewDidLoad() { + super.viewDidLoad() + configure() + } + +} + +// MARK: - Extensions - + +extension ___VARIABLE_moduleName___ViewController: ___VARIABLE_moduleName___ViewInterface { +} + +private extension ___VARIABLE_moduleName___ViewController { + + func configure() { + let output = ___VARIABLE_moduleName___.ViewOutput() + + let input = presenter.configure(with: output) + } + +} diff --git a/Templates/VIPER Templates/RxModule.xctemplate/StoryboardInteractor/___FILEBASENAME___Wireframe.swift b/Templates/VIPER Templates/RxModule.xctemplate/StoryboardInteractor/___FILEBASENAME___Wireframe.swift new file mode 100644 index 0000000..432eaeb --- /dev/null +++ b/Templates/VIPER Templates/RxModule.xctemplate/StoryboardInteractor/___FILEBASENAME___Wireframe.swift @@ -0,0 +1,37 @@ +// +// ___FILENAME___ +// ___PROJECTNAME___ +// +// Created by ___FULLUSERNAME___ on ___DATE___. +// Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. +// +// This file was generated by the 🐍 VIPER generator +// + +import UIKit +import RxSwift +import RxCocoa + +final class ___VARIABLE_moduleName___Wireframe: BaseWireframe { + + // MARK: - Private properties - + + private let storyboard = UIStoryboard(name: "___VARIABLE_moduleName___", bundle: nil) + + // MARK: - Module setup - + + init() { + let moduleViewController = storyboard.instantiateViewController(ofType: ___VARIABLE_moduleName___ViewController.self) + super.init(viewController: moduleViewController) + + let interactor = ___VARIABLE_moduleName___Interactor() + let presenter = ___VARIABLE_moduleName___Presenter(view: moduleViewController, interactor: interactor, wireframe: self) + moduleViewController.presenter = presenter + } + +} + +// MARK: - Extensions - + +extension ___VARIABLE_moduleName___Wireframe: ___VARIABLE_moduleName___WireframeInterface { +} diff --git a/Templates/VIPER Templates/RxModule.xctemplate/StoryboardInteractorAndFormatter/___FILEBASENAME___.storyboard b/Templates/VIPER Templates/RxModule.xctemplate/StoryboardInteractorAndFormatter/___FILEBASENAME___.storyboard new file mode 100644 index 0000000..121f30b --- /dev/null +++ b/Templates/VIPER Templates/RxModule.xctemplate/StoryboardInteractorAndFormatter/___FILEBASENAME___.storyboard @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Templates/VIPER Templates/RxModule.xctemplate/StoryboardInteractorAndFormatter/___FILEBASENAME___Formatter.swift b/Templates/VIPER Templates/RxModule.xctemplate/StoryboardInteractorAndFormatter/___FILEBASENAME___Formatter.swift new file mode 100644 index 0000000..7e26c0b --- /dev/null +++ b/Templates/VIPER Templates/RxModule.xctemplate/StoryboardInteractorAndFormatter/___FILEBASENAME___Formatter.swift @@ -0,0 +1,26 @@ +// +// ___FILENAME___ +// ___PROJECTNAME___ +// +// Created by ___FULLUSERNAME___ on ___DATE___. +// Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. +// +// This file was generated by the 🐍 VIPER generator +// + +import UIKit +import RxSwift +import RxCocoa + +final class ___VARIABLE_moduleName___Formatter { +} + +// MARK: - Extensions - + +extension ___VARIABLE_moduleName___Formatter: ___VARIABLE_moduleName___FormatterInterface { + + func format(for input: ___VARIABLE_moduleName___.FormatterInput) -> ___VARIABLE_moduleName___.FormatterOutput { + return ___VARIABLE_moduleName___.FormatterOutput() + } + +} diff --git a/Templates/VIPER Templates/RxModule.xctemplate/StoryboardInteractorAndFormatter/___FILEBASENAME___Interactor.swift b/Templates/VIPER Templates/RxModule.xctemplate/StoryboardInteractorAndFormatter/___FILEBASENAME___Interactor.swift new file mode 100644 index 0000000..02d9dba --- /dev/null +++ b/Templates/VIPER Templates/RxModule.xctemplate/StoryboardInteractorAndFormatter/___FILEBASENAME___Interactor.swift @@ -0,0 +1,20 @@ +// +// ___FILENAME___ +// ___PROJECTNAME___ +// +// Created by ___FULLUSERNAME___ on ___DATE___. +// Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. +// +// This file was generated by the 🐍 VIPER generator +// + +import Foundation +import RxSwift + +final class ___VARIABLE_moduleName___Interactor { +} + +// MARK: - Extensions - + +extension ___VARIABLE_moduleName___Interactor: ___VARIABLE_moduleName___InteractorInterface { +} diff --git a/Templates/VIPER Templates/RxModule.xctemplate/StoryboardInteractorAndFormatter/___FILEBASENAME___Interfaces.swift b/Templates/VIPER Templates/RxModule.xctemplate/StoryboardInteractorAndFormatter/___FILEBASENAME___Interfaces.swift new file mode 100644 index 0000000..32c388a --- /dev/null +++ b/Templates/VIPER Templates/RxModule.xctemplate/StoryboardInteractorAndFormatter/___FILEBASENAME___Interfaces.swift @@ -0,0 +1,47 @@ +// +// ___FILENAME___ +// ___PROJECTNAME___ +// +// Created by ___FULLUSERNAME___ on ___DATE___. +// Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. +// +// This file was generated by the 🐍 VIPER generator +// + +import UIKit +import RxSwift +import RxCocoa + +enum ___VARIABLE_moduleName___ { + + struct ViewOutput { + } + + struct ViewInput { + let models: FormatterOutput + } + + struct FormatterInput { + } + + struct FormatterOutput { + } + +} + +protocol ___VARIABLE_moduleName___WireframeInterface: WireframeInterface { +} + +protocol ___VARIABLE_moduleName___ViewInterface: ViewInterface { +} + +protocol ___VARIABLE_moduleName___PresenterInterface: PresenterInterface { + func configure(with output: ___VARIABLE_moduleName___.ViewOutput) -> ___VARIABLE_moduleName___.ViewInput +} + +protocol ___VARIABLE_moduleName___FormatterInterface: FormatterInterface { + func format(for input: ___VARIABLE_moduleName___.FormatterInput) -> ___VARIABLE_moduleName___.FormatterOutput +} + +protocol ___VARIABLE_moduleName___InteractorInterface: InteractorInterface { +} diff --git a/Templates/VIPER Templates/RxModule.xctemplate/StoryboardInteractorAndFormatter/___FILEBASENAME___Presenter.swift b/Templates/VIPER Templates/RxModule.xctemplate/StoryboardInteractorAndFormatter/___FILEBASENAME___Presenter.swift new file mode 100644 index 0000000..24e2354 --- /dev/null +++ b/Templates/VIPER Templates/RxModule.xctemplate/StoryboardInteractorAndFormatter/___FILEBASENAME___Presenter.swift @@ -0,0 +1,47 @@ +// +// ___FILENAME___ +// ___PROJECTNAME___ +// +// Created by ___FULLUSERNAME___ on ___DATE___. +// Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. +// +// This file was generated by the 🐍 VIPER generator +// + +import UIKit +import RxSwift +import RxCocoa + +final class ___VARIABLE_moduleName___Presenter { + + // MARK: - Private properties - + + private unowned let view: ___VARIABLE_moduleName___ViewInterface + private let formatter: ___VARIABLE_moduleName___FormatterInterface + private let interactor: ___VARIABLE_moduleName___InteractorInterface + private let wireframe: ___VARIABLE_moduleName___WireframeInterface + + // MARK: - Lifecycle - + + init(view: ___VARIABLE_moduleName___ViewInterface, formatter: ___VARIABLE_moduleName___FormatterInterface, interactor: ___VARIABLE_moduleName___InteractorInterface, wireframe: ___VARIABLE_moduleName___WireframeInterface) { + self.view = view + self.formatter = formatter + self.interactor = interactor + self.wireframe = wireframe + } +} + +// MARK: - Extensions - + +extension ___VARIABLE_moduleName___Presenter: ___VARIABLE_moduleName___PresenterInterface { + + func configure(with output: ___VARIABLE_moduleName___.ViewOutput) -> ___VARIABLE_moduleName___.ViewInput { + + let formatterInput = ___VARIABLE_moduleName___.FormatterInput() + + let formatterOutput = formatter.format(for: formatterInput) + + return ___VARIABLE_moduleName___.ViewInput(models: formatterOutput) + } + +} diff --git a/Templates/VIPER Templates/RxModule.xctemplate/StoryboardInteractorAndFormatter/___FILEBASENAME___ViewController.swift b/Templates/VIPER Templates/RxModule.xctemplate/StoryboardInteractorAndFormatter/___FILEBASENAME___ViewController.swift new file mode 100644 index 0000000..a38cc70 --- /dev/null +++ b/Templates/VIPER Templates/RxModule.xctemplate/StoryboardInteractorAndFormatter/___FILEBASENAME___ViewController.swift @@ -0,0 +1,47 @@ +// +// ___FILENAME___ +// ___PROJECTNAME___ +// +// Created by ___FULLUSERNAME___ on ___DATE___. +// Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. +// +// This file was generated by the 🐍 VIPER generator +// + +import UIKit +import RxSwift +import RxCocoa + +final class ___VARIABLE_moduleName___ViewController: UIViewController { + + // MARK: - Public properties - + + var presenter: ___VARIABLE_moduleName___PresenterInterface! + + // MARK: - Private properties - + + private let disposeBag = DisposeBag() + + // MARK: - Lifecycle - + + override func viewDidLoad() { + super.viewDidLoad() + configure() + } + +} + +// MARK: - Extensions - + +extension ___VARIABLE_moduleName___ViewController: ___VARIABLE_moduleName___ViewInterface { +} + +private extension ___VARIABLE_moduleName___ViewController { + + func configure() { + let output = ___VARIABLE_moduleName___.ViewOutput() + + let input = presenter.configure(with: output) + } + +} diff --git a/Templates/VIPER Templates/RxModule.xctemplate/StoryboardInteractorAndFormatter/___FILEBASENAME___Wireframe.swift b/Templates/VIPER Templates/RxModule.xctemplate/StoryboardInteractorAndFormatter/___FILEBASENAME___Wireframe.swift new file mode 100644 index 0000000..06be2be --- /dev/null +++ b/Templates/VIPER Templates/RxModule.xctemplate/StoryboardInteractorAndFormatter/___FILEBASENAME___Wireframe.swift @@ -0,0 +1,38 @@ +// +// ___FILENAME___ +// ___PROJECTNAME___ +// +// Created by ___FULLUSERNAME___ on ___DATE___. +// Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. +// +// This file was generated by the 🐍 VIPER generator +// + +import UIKit +import RxSwift +import RxCocoa + +final class ___VARIABLE_moduleName___Wireframe: BaseWireframe { + + // MARK: - Private properties - + + private let storyboard = UIStoryboard(name: "___VARIABLE_moduleName___", bundle: nil) + + // MARK: - Module setup - + + init() { + let moduleViewController = storyboard.instantiateViewController(ofType: ___VARIABLE_moduleName___ViewController.self) + super.init(viewController: moduleViewController) + + let formatter = ___VARIABLE_moduleName___Formatter() + let interactor = ___VARIABLE_moduleName___Interactor() + let presenter = ___VARIABLE_moduleName___Presenter(view: moduleViewController, formatter: formatter, interactor: interactor, wireframe: self) + moduleViewController.presenter = presenter + } + +} + +// MARK: - Extensions - + +extension ___VARIABLE_moduleName___Wireframe: ___VARIABLE_moduleName___WireframeInterface { +} diff --git a/Templates/VIPER Templates/RxModule.xctemplate/StoryboardSimple/___FILEBASENAME___.storyboard b/Templates/VIPER Templates/RxModule.xctemplate/StoryboardSimple/___FILEBASENAME___.storyboard new file mode 100644 index 0000000..121f30b --- /dev/null +++ b/Templates/VIPER Templates/RxModule.xctemplate/StoryboardSimple/___FILEBASENAME___.storyboard @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Templates/VIPER Templates/RxModule.xctemplate/StoryboardSimple/___FILEBASENAME___Interfaces.swift b/Templates/VIPER Templates/RxModule.xctemplate/StoryboardSimple/___FILEBASENAME___Interfaces.swift new file mode 100644 index 0000000..4b9643e --- /dev/null +++ b/Templates/VIPER Templates/RxModule.xctemplate/StoryboardSimple/___FILEBASENAME___Interfaces.swift @@ -0,0 +1,33 @@ +// +// ___FILENAME___ +// ___PROJECTNAME___ +// +// Created by ___FULLUSERNAME___ on ___DATE___. +// Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. +// +// This file was generated by the 🐍 VIPER generator +// + +import UIKit +import RxSwift +import RxCocoa + +enum ___VARIABLE_moduleName___ { + + struct ViewOutput { + } + + struct ViewInput { + } + +} + +protocol ___VARIABLE_moduleName___WireframeInterface: WireframeInterface { +} + +protocol ___VARIABLE_moduleName___ViewInterface: ViewInterface { +} + +protocol ___VARIABLE_moduleName___PresenterInterface: PresenterInterface { + func configure(with output: ___VARIABLE_moduleName___.ViewOutput) -> ___VARIABLE_moduleName___.ViewInput +} diff --git a/Templates/VIPER Templates/RxModule.xctemplate/StoryboardSimple/___FILEBASENAME___Presenter.swift b/Templates/VIPER Templates/RxModule.xctemplate/StoryboardSimple/___FILEBASENAME___Presenter.swift new file mode 100644 index 0000000..44562eb --- /dev/null +++ b/Templates/VIPER Templates/RxModule.xctemplate/StoryboardSimple/___FILEBASENAME___Presenter.swift @@ -0,0 +1,38 @@ +// +// ___FILENAME___ +// ___PROJECTNAME___ +// +// Created by ___FULLUSERNAME___ on ___DATE___. +// Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. +// +// This file was generated by the 🐍 VIPER generator +// + +import UIKit +import RxSwift +import RxCocoa + +final class ___VARIABLE_moduleName___Presenter { + + // MARK: - Private properties - + + private unowned let view: ___VARIABLE_moduleName___ViewInterface + private let wireframe: ___VARIABLE_moduleName___WireframeInterface + + // MARK: - Lifecycle - + + init(view: ___VARIABLE_moduleName___ViewInterface, wireframe: ___VARIABLE_moduleName___WireframeInterface) { + self.view = view + self.wireframe = wireframe + } +} + +// MARK: - Extensions - + +extension ___VARIABLE_moduleName___Presenter: ___VARIABLE_moduleName___PresenterInterface { + + func configure(with output: ___VARIABLE_moduleName___.ViewOutput) -> ___VARIABLE_moduleName___.ViewInput { + return ___VARIABLE_moduleName___.ViewInput() + } + +} diff --git a/Templates/VIPER Templates/RxModule.xctemplate/StoryboardSimple/___FILEBASENAME___ViewController.swift b/Templates/VIPER Templates/RxModule.xctemplate/StoryboardSimple/___FILEBASENAME___ViewController.swift new file mode 100644 index 0000000..a38cc70 --- /dev/null +++ b/Templates/VIPER Templates/RxModule.xctemplate/StoryboardSimple/___FILEBASENAME___ViewController.swift @@ -0,0 +1,47 @@ +// +// ___FILENAME___ +// ___PROJECTNAME___ +// +// Created by ___FULLUSERNAME___ on ___DATE___. +// Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. +// +// This file was generated by the 🐍 VIPER generator +// + +import UIKit +import RxSwift +import RxCocoa + +final class ___VARIABLE_moduleName___ViewController: UIViewController { + + // MARK: - Public properties - + + var presenter: ___VARIABLE_moduleName___PresenterInterface! + + // MARK: - Private properties - + + private let disposeBag = DisposeBag() + + // MARK: - Lifecycle - + + override func viewDidLoad() { + super.viewDidLoad() + configure() + } + +} + +// MARK: - Extensions - + +extension ___VARIABLE_moduleName___ViewController: ___VARIABLE_moduleName___ViewInterface { +} + +private extension ___VARIABLE_moduleName___ViewController { + + func configure() { + let output = ___VARIABLE_moduleName___.ViewOutput() + + let input = presenter.configure(with: output) + } + +} diff --git a/Templates/VIPER Templates/RxModule.xctemplate/StoryboardSimple/___FILEBASENAME___Wireframe.swift b/Templates/VIPER Templates/RxModule.xctemplate/StoryboardSimple/___FILEBASENAME___Wireframe.swift new file mode 100644 index 0000000..2d73c53 --- /dev/null +++ b/Templates/VIPER Templates/RxModule.xctemplate/StoryboardSimple/___FILEBASENAME___Wireframe.swift @@ -0,0 +1,36 @@ +// +// ___FILENAME___ +// ___PROJECTNAME___ +// +// Created by ___FULLUSERNAME___ on ___DATE___. +// Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. +// +// This file was generated by the 🐍 VIPER generator +// + +import UIKit +import RxSwift +import RxCocoa + +final class ___VARIABLE_moduleName___Wireframe: BaseWireframe { + + // MARK: - Private properties - + + private let storyboard = UIStoryboard(name: "___VARIABLE_moduleName___", bundle: nil) + + // MARK: - Module setup - + + init() { + let moduleViewController = storyboard.instantiateViewController(ofType: ___VARIABLE_moduleName___ViewController.self) + super.init(viewController: moduleViewController) + + let presenter = ___VARIABLE_moduleName___Presenter(view: moduleViewController, wireframe: self) + moduleViewController.presenter = presenter + } + +} + +// MARK: - Extensions - + +extension ___VARIABLE_moduleName___Wireframe: ___VARIABLE_moduleName___WireframeInterface { +} diff --git a/Templates/VIPER Templates/RxModule.xctemplate/TemplateIcon.png b/Templates/VIPER Templates/RxModule.xctemplate/TemplateIcon.png new file mode 100644 index 0000000..21ba540 Binary files /dev/null and b/Templates/VIPER Templates/RxModule.xctemplate/TemplateIcon.png differ diff --git a/Templates/VIPER Templates/RxModule.xctemplate/TemplateIcon@2x.png b/Templates/VIPER Templates/RxModule.xctemplate/TemplateIcon@2x.png new file mode 100644 index 0000000..f95e65c Binary files /dev/null and b/Templates/VIPER Templates/RxModule.xctemplate/TemplateIcon@2x.png differ diff --git a/Templates/VIPER Templates/RxModule.xctemplate/TemplateIcon@3x.png b/Templates/VIPER Templates/RxModule.xctemplate/TemplateIcon@3x.png new file mode 100644 index 0000000..f47277e Binary files /dev/null and b/Templates/VIPER Templates/RxModule.xctemplate/TemplateIcon@3x.png differ diff --git a/Templates/VIPER Templates/RxModule.xctemplate/TemplateInfo.plist b/Templates/VIPER Templates/RxModule.xctemplate/TemplateInfo.plist new file mode 100644 index 0000000..ecb8d17 --- /dev/null +++ b/Templates/VIPER Templates/RxModule.xctemplate/TemplateInfo.plist @@ -0,0 +1,81 @@ + + + + + DefaultCompletionName + VIPERModule + Description + This generates a new Module using 🐍VIPER generator. + Kind + Xcode.IDEKit.TextSubstitutionFileTemplateKind + Options + + + Description + The name of the module to create + Default + + Identifier + moduleName + Name + New RxModule Name: + Required + YES + Type + text + + + Default + ___VARIABLE_moduleName___ + Identifier + productName + Type + static + + + Identifier + interface + Name + Generate Interface Builder: + Description + Which interface builder to generate + Type + popup + Default + None + Values + + XIB + None + Storyboard + + + + Identifier + complex + Name + Module Complexity: + Description + Type of a module to generate - simple, with interactor, or with interactor and formatter + Type + popup + Default + Interactor + Values + + Simple + Interactor + InteractorAndFormatter + + + + Platforms + + com.apple.platform.iphoneos + + SortOrder + 1 + Summary + This generates a new 🐍 VIPER module. + + diff --git a/Templates/VIPER Templates/RxModule.xctemplate/XIBInteractor/___FILEBASENAME___Interactor.swift b/Templates/VIPER Templates/RxModule.xctemplate/XIBInteractor/___FILEBASENAME___Interactor.swift new file mode 100644 index 0000000..02d9dba --- /dev/null +++ b/Templates/VIPER Templates/RxModule.xctemplate/XIBInteractor/___FILEBASENAME___Interactor.swift @@ -0,0 +1,20 @@ +// +// ___FILENAME___ +// ___PROJECTNAME___ +// +// Created by ___FULLUSERNAME___ on ___DATE___. +// Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. +// +// This file was generated by the 🐍 VIPER generator +// + +import Foundation +import RxSwift + +final class ___VARIABLE_moduleName___Interactor { +} + +// MARK: - Extensions - + +extension ___VARIABLE_moduleName___Interactor: ___VARIABLE_moduleName___InteractorInterface { +} diff --git a/Templates/VIPER Templates/RxModule.xctemplate/XIBInteractor/___FILEBASENAME___Interfaces.swift b/Templates/VIPER Templates/RxModule.xctemplate/XIBInteractor/___FILEBASENAME___Interfaces.swift new file mode 100644 index 0000000..53cf848 --- /dev/null +++ b/Templates/VIPER Templates/RxModule.xctemplate/XIBInteractor/___FILEBASENAME___Interfaces.swift @@ -0,0 +1,36 @@ +// +// ___FILENAME___ +// ___PROJECTNAME___ +// +// Created by ___FULLUSERNAME___ on ___DATE___. +// Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. +// +// This file was generated by the 🐍 VIPER generator +// + +import UIKit +import RxSwift +import RxCocoa + +enum ___VARIABLE_moduleName___ { + + struct ViewOutput { + } + + struct ViewInput { + } + +} + +protocol ___VARIABLE_moduleName___WireframeInterface: WireframeInterface { +} + +protocol ___VARIABLE_moduleName___ViewInterface: ViewInterface { +} + +protocol ___VARIABLE_moduleName___PresenterInterface: PresenterInterface { + func configure(with output: ___VARIABLE_moduleName___.ViewOutput) -> ___VARIABLE_moduleName___.ViewInput +} + +protocol ___VARIABLE_moduleName___InteractorInterface: InteractorInterface { +} diff --git a/Templates/VIPER Templates/RxModule.xctemplate/XIBInteractor/___FILEBASENAME___Presenter.swift b/Templates/VIPER Templates/RxModule.xctemplate/XIBInteractor/___FILEBASENAME___Presenter.swift new file mode 100644 index 0000000..5f2e521 --- /dev/null +++ b/Templates/VIPER Templates/RxModule.xctemplate/XIBInteractor/___FILEBASENAME___Presenter.swift @@ -0,0 +1,40 @@ +// +// ___FILENAME___ +// ___PROJECTNAME___ +// +// Created by ___FULLUSERNAME___ on ___DATE___. +// Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. +// +// This file was generated by the 🐍 VIPER generator +// + +import UIKit +import RxSwift +import RxCocoa + +final class ___VARIABLE_moduleName___Presenter { + + // MARK: - Private properties - + + private unowned let view: ___VARIABLE_moduleName___ViewInterface + private let interactor: ___VARIABLE_moduleName___InteractorInterface + private let wireframe: ___VARIABLE_moduleName___WireframeInterface + + // MARK: - Lifecycle - + + init(view: ___VARIABLE_moduleName___ViewInterface, interactor: ___VARIABLE_moduleName___InteractorInterface, wireframe: ___VARIABLE_moduleName___WireframeInterface) { + self.view = view + self.interactor = interactor + self.wireframe = wireframe + } +} + +// MARK: - Extensions - + +extension ___VARIABLE_moduleName___Presenter: ___VARIABLE_moduleName___PresenterInterface { + + func configure(with output: ___VARIABLE_moduleName___.ViewOutput) -> ___VARIABLE_moduleName___.ViewInput { + return ___VARIABLE_moduleName___.ViewInput() + } + +} diff --git a/Templates/VIPER Templates/RxModule.xctemplate/XIBInteractor/___FILEBASENAME___ViewController.swift b/Templates/VIPER Templates/RxModule.xctemplate/XIBInteractor/___FILEBASENAME___ViewController.swift new file mode 100644 index 0000000..a38cc70 --- /dev/null +++ b/Templates/VIPER Templates/RxModule.xctemplate/XIBInteractor/___FILEBASENAME___ViewController.swift @@ -0,0 +1,47 @@ +// +// ___FILENAME___ +// ___PROJECTNAME___ +// +// Created by ___FULLUSERNAME___ on ___DATE___. +// Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. +// +// This file was generated by the 🐍 VIPER generator +// + +import UIKit +import RxSwift +import RxCocoa + +final class ___VARIABLE_moduleName___ViewController: UIViewController { + + // MARK: - Public properties - + + var presenter: ___VARIABLE_moduleName___PresenterInterface! + + // MARK: - Private properties - + + private let disposeBag = DisposeBag() + + // MARK: - Lifecycle - + + override func viewDidLoad() { + super.viewDidLoad() + configure() + } + +} + +// MARK: - Extensions - + +extension ___VARIABLE_moduleName___ViewController: ___VARIABLE_moduleName___ViewInterface { +} + +private extension ___VARIABLE_moduleName___ViewController { + + func configure() { + let output = ___VARIABLE_moduleName___.ViewOutput() + + let input = presenter.configure(with: output) + } + +} diff --git a/Templates/VIPER Templates/RxModule.xctemplate/XIBInteractor/___FILEBASENAME___ViewController.xib b/Templates/VIPER Templates/RxModule.xctemplate/XIBInteractor/___FILEBASENAME___ViewController.xib new file mode 100644 index 0000000..949017e --- /dev/null +++ b/Templates/VIPER Templates/RxModule.xctemplate/XIBInteractor/___FILEBASENAME___ViewController.xib @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/Templates/VIPER Templates/RxModule.xctemplate/XIBInteractor/___FILEBASENAME___Wireframe.swift b/Templates/VIPER Templates/RxModule.xctemplate/XIBInteractor/___FILEBASENAME___Wireframe.swift new file mode 100644 index 0000000..303e39d --- /dev/null +++ b/Templates/VIPER Templates/RxModule.xctemplate/XIBInteractor/___FILEBASENAME___Wireframe.swift @@ -0,0 +1,33 @@ +// +// ___FILENAME___ +// ___PROJECTNAME___ +// +// Created by ___FULLUSERNAME___ on ___DATE___. +// Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. +// +// This file was generated by the 🐍 VIPER generator +// + +import UIKit +import RxSwift +import RxCocoa + +final class ___VARIABLE_moduleName___Wireframe: BaseWireframe { + + // MARK: - Module setup - + + init() { + let moduleViewController = ___VARIABLE_moduleName___ViewController() + super.init(viewController: moduleViewController) + + let interactor = ___VARIABLE_moduleName___Interactor() + let presenter = ___VARIABLE_moduleName___Presenter(view: moduleViewController, interactor: interactor, wireframe: self) + moduleViewController.presenter = presenter + } + +} + +// MARK: - Extensions - + +extension ___VARIABLE_moduleName___Wireframe: ___VARIABLE_moduleName___WireframeInterface { +} diff --git a/Templates/VIPER Templates/RxModule.xctemplate/XIBInteractorAndFormatter/___FILEBASENAME___Formatter.swift b/Templates/VIPER Templates/RxModule.xctemplate/XIBInteractorAndFormatter/___FILEBASENAME___Formatter.swift new file mode 100644 index 0000000..7e26c0b --- /dev/null +++ b/Templates/VIPER Templates/RxModule.xctemplate/XIBInteractorAndFormatter/___FILEBASENAME___Formatter.swift @@ -0,0 +1,26 @@ +// +// ___FILENAME___ +// ___PROJECTNAME___ +// +// Created by ___FULLUSERNAME___ on ___DATE___. +// Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. +// +// This file was generated by the 🐍 VIPER generator +// + +import UIKit +import RxSwift +import RxCocoa + +final class ___VARIABLE_moduleName___Formatter { +} + +// MARK: - Extensions - + +extension ___VARIABLE_moduleName___Formatter: ___VARIABLE_moduleName___FormatterInterface { + + func format(for input: ___VARIABLE_moduleName___.FormatterInput) -> ___VARIABLE_moduleName___.FormatterOutput { + return ___VARIABLE_moduleName___.FormatterOutput() + } + +} diff --git a/Templates/VIPER Templates/RxModule.xctemplate/XIBInteractorAndFormatter/___FILEBASENAME___Interactor.swift b/Templates/VIPER Templates/RxModule.xctemplate/XIBInteractorAndFormatter/___FILEBASENAME___Interactor.swift new file mode 100644 index 0000000..02d9dba --- /dev/null +++ b/Templates/VIPER Templates/RxModule.xctemplate/XIBInteractorAndFormatter/___FILEBASENAME___Interactor.swift @@ -0,0 +1,20 @@ +// +// ___FILENAME___ +// ___PROJECTNAME___ +// +// Created by ___FULLUSERNAME___ on ___DATE___. +// Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. +// +// This file was generated by the 🐍 VIPER generator +// + +import Foundation +import RxSwift + +final class ___VARIABLE_moduleName___Interactor { +} + +// MARK: - Extensions - + +extension ___VARIABLE_moduleName___Interactor: ___VARIABLE_moduleName___InteractorInterface { +} diff --git a/Templates/VIPER Templates/RxModule.xctemplate/XIBInteractorAndFormatter/___FILEBASENAME___Interfaces.swift b/Templates/VIPER Templates/RxModule.xctemplate/XIBInteractorAndFormatter/___FILEBASENAME___Interfaces.swift new file mode 100644 index 0000000..32c388a --- /dev/null +++ b/Templates/VIPER Templates/RxModule.xctemplate/XIBInteractorAndFormatter/___FILEBASENAME___Interfaces.swift @@ -0,0 +1,47 @@ +// +// ___FILENAME___ +// ___PROJECTNAME___ +// +// Created by ___FULLUSERNAME___ on ___DATE___. +// Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. +// +// This file was generated by the 🐍 VIPER generator +// + +import UIKit +import RxSwift +import RxCocoa + +enum ___VARIABLE_moduleName___ { + + struct ViewOutput { + } + + struct ViewInput { + let models: FormatterOutput + } + + struct FormatterInput { + } + + struct FormatterOutput { + } + +} + +protocol ___VARIABLE_moduleName___WireframeInterface: WireframeInterface { +} + +protocol ___VARIABLE_moduleName___ViewInterface: ViewInterface { +} + +protocol ___VARIABLE_moduleName___PresenterInterface: PresenterInterface { + func configure(with output: ___VARIABLE_moduleName___.ViewOutput) -> ___VARIABLE_moduleName___.ViewInput +} + +protocol ___VARIABLE_moduleName___FormatterInterface: FormatterInterface { + func format(for input: ___VARIABLE_moduleName___.FormatterInput) -> ___VARIABLE_moduleName___.FormatterOutput +} + +protocol ___VARIABLE_moduleName___InteractorInterface: InteractorInterface { +} diff --git a/Templates/VIPER Templates/RxModule.xctemplate/XIBInteractorAndFormatter/___FILEBASENAME___Presenter.swift b/Templates/VIPER Templates/RxModule.xctemplate/XIBInteractorAndFormatter/___FILEBASENAME___Presenter.swift new file mode 100644 index 0000000..24e2354 --- /dev/null +++ b/Templates/VIPER Templates/RxModule.xctemplate/XIBInteractorAndFormatter/___FILEBASENAME___Presenter.swift @@ -0,0 +1,47 @@ +// +// ___FILENAME___ +// ___PROJECTNAME___ +// +// Created by ___FULLUSERNAME___ on ___DATE___. +// Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. +// +// This file was generated by the 🐍 VIPER generator +// + +import UIKit +import RxSwift +import RxCocoa + +final class ___VARIABLE_moduleName___Presenter { + + // MARK: - Private properties - + + private unowned let view: ___VARIABLE_moduleName___ViewInterface + private let formatter: ___VARIABLE_moduleName___FormatterInterface + private let interactor: ___VARIABLE_moduleName___InteractorInterface + private let wireframe: ___VARIABLE_moduleName___WireframeInterface + + // MARK: - Lifecycle - + + init(view: ___VARIABLE_moduleName___ViewInterface, formatter: ___VARIABLE_moduleName___FormatterInterface, interactor: ___VARIABLE_moduleName___InteractorInterface, wireframe: ___VARIABLE_moduleName___WireframeInterface) { + self.view = view + self.formatter = formatter + self.interactor = interactor + self.wireframe = wireframe + } +} + +// MARK: - Extensions - + +extension ___VARIABLE_moduleName___Presenter: ___VARIABLE_moduleName___PresenterInterface { + + func configure(with output: ___VARIABLE_moduleName___.ViewOutput) -> ___VARIABLE_moduleName___.ViewInput { + + let formatterInput = ___VARIABLE_moduleName___.FormatterInput() + + let formatterOutput = formatter.format(for: formatterInput) + + return ___VARIABLE_moduleName___.ViewInput(models: formatterOutput) + } + +} diff --git a/Templates/VIPER Templates/RxModule.xctemplate/XIBInteractorAndFormatter/___FILEBASENAME___ViewController.swift b/Templates/VIPER Templates/RxModule.xctemplate/XIBInteractorAndFormatter/___FILEBASENAME___ViewController.swift new file mode 100644 index 0000000..a38cc70 --- /dev/null +++ b/Templates/VIPER Templates/RxModule.xctemplate/XIBInteractorAndFormatter/___FILEBASENAME___ViewController.swift @@ -0,0 +1,47 @@ +// +// ___FILENAME___ +// ___PROJECTNAME___ +// +// Created by ___FULLUSERNAME___ on ___DATE___. +// Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. +// +// This file was generated by the 🐍 VIPER generator +// + +import UIKit +import RxSwift +import RxCocoa + +final class ___VARIABLE_moduleName___ViewController: UIViewController { + + // MARK: - Public properties - + + var presenter: ___VARIABLE_moduleName___PresenterInterface! + + // MARK: - Private properties - + + private let disposeBag = DisposeBag() + + // MARK: - Lifecycle - + + override func viewDidLoad() { + super.viewDidLoad() + configure() + } + +} + +// MARK: - Extensions - + +extension ___VARIABLE_moduleName___ViewController: ___VARIABLE_moduleName___ViewInterface { +} + +private extension ___VARIABLE_moduleName___ViewController { + + func configure() { + let output = ___VARIABLE_moduleName___.ViewOutput() + + let input = presenter.configure(with: output) + } + +} diff --git a/Templates/VIPER Templates/RxModule.xctemplate/XIBInteractorAndFormatter/___FILEBASENAME___ViewController.xib b/Templates/VIPER Templates/RxModule.xctemplate/XIBInteractorAndFormatter/___FILEBASENAME___ViewController.xib new file mode 100644 index 0000000..949017e --- /dev/null +++ b/Templates/VIPER Templates/RxModule.xctemplate/XIBInteractorAndFormatter/___FILEBASENAME___ViewController.xib @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/Templates/VIPER Templates/RxModule.xctemplate/XIBInteractorAndFormatter/___FILEBASENAME___Wireframe.swift b/Templates/VIPER Templates/RxModule.xctemplate/XIBInteractorAndFormatter/___FILEBASENAME___Wireframe.swift new file mode 100644 index 0000000..623e7d4 --- /dev/null +++ b/Templates/VIPER Templates/RxModule.xctemplate/XIBInteractorAndFormatter/___FILEBASENAME___Wireframe.swift @@ -0,0 +1,34 @@ +// +// ___FILENAME___ +// ___PROJECTNAME___ +// +// Created by ___FULLUSERNAME___ on ___DATE___. +// Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. +// +// This file was generated by the 🐍 VIPER generator +// + +import UIKit +import RxSwift +import RxCocoa + +final class ___VARIABLE_moduleName___Wireframe: BaseWireframe { + + // MARK: - Module setup - + + init() { + let moduleViewController = ___VARIABLE_moduleName___ViewController() + super.init(viewController: moduleViewController) + + let formatter = ___VARIABLE_moduleName___Formatter() + let interactor = ___VARIABLE_moduleName___Interactor() + let presenter = ___VARIABLE_moduleName___Presenter(view: moduleViewController, formatter: formatter, interactor: interactor, wireframe: self) + moduleViewController.presenter = presenter + } + +} + +// MARK: - Extensions - + +extension ___VARIABLE_moduleName___Wireframe: ___VARIABLE_moduleName___WireframeInterface { +} diff --git a/Templates/VIPER Templates/RxModule.xctemplate/XIBSimple/___FILEBASENAME___Interfaces.swift b/Templates/VIPER Templates/RxModule.xctemplate/XIBSimple/___FILEBASENAME___Interfaces.swift new file mode 100644 index 0000000..4b9643e --- /dev/null +++ b/Templates/VIPER Templates/RxModule.xctemplate/XIBSimple/___FILEBASENAME___Interfaces.swift @@ -0,0 +1,33 @@ +// +// ___FILENAME___ +// ___PROJECTNAME___ +// +// Created by ___FULLUSERNAME___ on ___DATE___. +// Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. +// +// This file was generated by the 🐍 VIPER generator +// + +import UIKit +import RxSwift +import RxCocoa + +enum ___VARIABLE_moduleName___ { + + struct ViewOutput { + } + + struct ViewInput { + } + +} + +protocol ___VARIABLE_moduleName___WireframeInterface: WireframeInterface { +} + +protocol ___VARIABLE_moduleName___ViewInterface: ViewInterface { +} + +protocol ___VARIABLE_moduleName___PresenterInterface: PresenterInterface { + func configure(with output: ___VARIABLE_moduleName___.ViewOutput) -> ___VARIABLE_moduleName___.ViewInput +} diff --git a/Templates/VIPER Templates/RxModule.xctemplate/XIBSimple/___FILEBASENAME___Presenter.swift b/Templates/VIPER Templates/RxModule.xctemplate/XIBSimple/___FILEBASENAME___Presenter.swift new file mode 100644 index 0000000..44562eb --- /dev/null +++ b/Templates/VIPER Templates/RxModule.xctemplate/XIBSimple/___FILEBASENAME___Presenter.swift @@ -0,0 +1,38 @@ +// +// ___FILENAME___ +// ___PROJECTNAME___ +// +// Created by ___FULLUSERNAME___ on ___DATE___. +// Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. +// +// This file was generated by the 🐍 VIPER generator +// + +import UIKit +import RxSwift +import RxCocoa + +final class ___VARIABLE_moduleName___Presenter { + + // MARK: - Private properties - + + private unowned let view: ___VARIABLE_moduleName___ViewInterface + private let wireframe: ___VARIABLE_moduleName___WireframeInterface + + // MARK: - Lifecycle - + + init(view: ___VARIABLE_moduleName___ViewInterface, wireframe: ___VARIABLE_moduleName___WireframeInterface) { + self.view = view + self.wireframe = wireframe + } +} + +// MARK: - Extensions - + +extension ___VARIABLE_moduleName___Presenter: ___VARIABLE_moduleName___PresenterInterface { + + func configure(with output: ___VARIABLE_moduleName___.ViewOutput) -> ___VARIABLE_moduleName___.ViewInput { + return ___VARIABLE_moduleName___.ViewInput() + } + +} diff --git a/Templates/VIPER Templates/RxModule.xctemplate/XIBSimple/___FILEBASENAME___ViewController.swift b/Templates/VIPER Templates/RxModule.xctemplate/XIBSimple/___FILEBASENAME___ViewController.swift new file mode 100644 index 0000000..a38cc70 --- /dev/null +++ b/Templates/VIPER Templates/RxModule.xctemplate/XIBSimple/___FILEBASENAME___ViewController.swift @@ -0,0 +1,47 @@ +// +// ___FILENAME___ +// ___PROJECTNAME___ +// +// Created by ___FULLUSERNAME___ on ___DATE___. +// Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. +// +// This file was generated by the 🐍 VIPER generator +// + +import UIKit +import RxSwift +import RxCocoa + +final class ___VARIABLE_moduleName___ViewController: UIViewController { + + // MARK: - Public properties - + + var presenter: ___VARIABLE_moduleName___PresenterInterface! + + // MARK: - Private properties - + + private let disposeBag = DisposeBag() + + // MARK: - Lifecycle - + + override func viewDidLoad() { + super.viewDidLoad() + configure() + } + +} + +// MARK: - Extensions - + +extension ___VARIABLE_moduleName___ViewController: ___VARIABLE_moduleName___ViewInterface { +} + +private extension ___VARIABLE_moduleName___ViewController { + + func configure() { + let output = ___VARIABLE_moduleName___.ViewOutput() + + let input = presenter.configure(with: output) + } + +} diff --git a/Templates/VIPER Templates/RxModule.xctemplate/XIBSimple/___FILEBASENAME___ViewController.xib b/Templates/VIPER Templates/RxModule.xctemplate/XIBSimple/___FILEBASENAME___ViewController.xib new file mode 100644 index 0000000..949017e --- /dev/null +++ b/Templates/VIPER Templates/RxModule.xctemplate/XIBSimple/___FILEBASENAME___ViewController.xib @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/Templates/VIPER Templates/RxModule.xctemplate/XIBSimple/___FILEBASENAME___Wireframe.swift b/Templates/VIPER Templates/RxModule.xctemplate/XIBSimple/___FILEBASENAME___Wireframe.swift new file mode 100644 index 0000000..ee67530 --- /dev/null +++ b/Templates/VIPER Templates/RxModule.xctemplate/XIBSimple/___FILEBASENAME___Wireframe.swift @@ -0,0 +1,32 @@ +// +// ___FILENAME___ +// ___PROJECTNAME___ +// +// Created by ___FULLUSERNAME___ on ___DATE___. +// Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. +// +// This file was generated by the 🐍 VIPER generator +// + +import UIKit +import RxSwift +import RxCocoa + +final class ___VARIABLE_moduleName___Wireframe: BaseWireframe { + + // MARK: - Module setup - + + init() { + let moduleViewController = ___VARIABLE_moduleName___ViewController() + super.init(viewController: moduleViewController) + + let presenter = ___VARIABLE_moduleName___Presenter(view: moduleViewController, wireframe: self) + moduleViewController.presenter = presenter + } + +} + +// MARK: - Extensions - + +extension ___VARIABLE_moduleName___Wireframe: ___VARIABLE_moduleName___WireframeInterface { +} diff --git a/Templates/generator.rb b/Templates/generator.rb new file mode 100644 index 0000000..0639d3e --- /dev/null +++ b/Templates/generator.rb @@ -0,0 +1,27 @@ +require 'erb' +require 'fileutils' + +class Generator + include ERB::Util + attr_accessor :template, :interface, :complexity + + def initialize(template_file, template, interface, complexity) + @template_file = IO.read template_file + @template = template + @interface = interface + @complexity = complexity + end + + def render() + ERB.new(@template_file, nil, "-").result(binding) + end + + def save(file_name) + dirname = File.dirname(file_name) + unless File.directory?(dirname) + FileUtils.mkdir_p(dirname) + end + IO.write(file_name, render) + end + +end \ No newline at end of file diff --git a/Templates/main.rb b/Templates/main.rb new file mode 100644 index 0000000..5a8ccc5 --- /dev/null +++ b/Templates/main.rb @@ -0,0 +1,90 @@ +#!/usr/bin/env ruby + +require 'fileutils' +require './generator' +require './parameters' + +PATH = "VIPER Templates" +RESOURCES = "Resources" + + +def generate_xib(template, interface, complexity, source_folder, destination_folder) + return unless interface.generate_xib + generator = Generator.new("#{source_folder}/___FILEBASENAME___ViewController.xib.erb", template, interface, complexity) + generator.save "#{destination_folder}/___FILEBASENAME___ViewController.xib" +end + +def generate_sb(template, interface, complexity, source_folder, destination_folder) + return unless interface.generate_sb + generator = Generator.new("#{source_folder}/___FILEBASENAME___.storyboard.erb", template, interface, complexity) + generator.save "#{destination_folder}/___FILEBASENAME___.storyboard" +end + +def generate_interfaces(template, interface, complexity, source_folder, destination_folder) + generator = Generator.new("#{source_folder}/___FILEBASENAME___Interfaces.swift.erb", template, interface, complexity) + generator.save "#{destination_folder}/___FILEBASENAME___Interfaces.swift" +end + +def generate_wireframe(template, interface, complexity, source_folder, destination_folder) + generator = Generator.new("#{source_folder}/___FILEBASENAME___Wireframe.swift.erb", template, interface, complexity) + generator.save "#{destination_folder}/___FILEBASENAME___Wireframe.swift" +end + +def generate_presenter(template, interface, complexity, source_folder, destination_folder) + generator = Generator.new("#{source_folder}/___FILEBASENAME___Presenter.swift.erb", template, interface, complexity) + generator.save "#{destination_folder}/___FILEBASENAME___Presenter.swift" +end + +def generate_interactor(template, interface, complexity, source_folder, destination_folder) + return unless complexity.generate_interactor + generator = Generator.new("#{source_folder}/___FILEBASENAME___Interactor.swift.erb", template, interface, complexity) + generator.save "#{destination_folder}/___FILEBASENAME___Interactor.swift" +end + +def generate_formatter(template, interface, complexity, source_folder, destination_folder) + return unless complexity.generate_formatter + generator = Generator.new("#{source_folder}/___FILEBASENAME___Formatter.swift.erb", template, interface, complexity) + generator.save "#{destination_folder}/___FILEBASENAME___Formatter.swift" +end + +def generate_view(template, interface, complexity, source_folder, destination_folder) + generator = Generator.new("#{source_folder}/___FILEBASENAME___ViewController.swift.erb", template, interface, complexity) + generator.save "#{destination_folder}/___FILEBASENAME___ViewController.swift" +end + +def generate(template, interface, complexity) + source_folder = "#{RESOURCES}/Templates" + destination_folder = "#{PATH}/#{template.name}.xctemplate/#{interface.name}#{complexity.name}" + generate_xib(template, interface, complexity, source_folder, destination_folder) + generate_sb(template, interface, complexity, source_folder, destination_folder) + generate_interfaces(template, interface, complexity, source_folder, destination_folder) + generate_wireframe(template, interface, complexity, source_folder, destination_folder) + generate_presenter(template, interface, complexity, source_folder, destination_folder) + generate_interactor(template, interface, complexity, source_folder, destination_folder) + generate_formatter(template, interface, complexity, source_folder, destination_folder) + generate_view(template, interface, complexity, source_folder, destination_folder) +end + +def generate_info_plist(template) + generator = Generator.new("#{RESOURCES}/TemplateInfo.plist.erb", template, Interface, Complexity) + generator.save "#{PATH}/#{template.name}.xctemplate/TemplateInfo.plist" +end + +def copy_images(template) + source = "#{RESOURCES}/Images/." + destination = "#{PATH}/#{template.name}.xctemplate" + FileUtils.cp_r source, destination +end + +Template.types.each do |template| + generate_info_plist template + copy_images template + + Interface.types.each do |interface| + Complexity.types.each do |complexity| + + generate(template, interface, complexity) + + end + end +end \ No newline at end of file diff --git a/Templates/parameters.rb b/Templates/parameters.rb new file mode 100644 index 0000000..c18486b --- /dev/null +++ b/Templates/parameters.rb @@ -0,0 +1,118 @@ +class Template + attr_accessor :name, :generate_io +end + +class Interface + attr_accessor :name, :generate_xib, :generate_sb, :wireframe_sb +end + +class Complexity + attr_accessor :name, :generate_interactor, :generate_formatter +end + +module Initializable + + def initialize(params) + params.each do |key, value| + instance_variable_set("@#{key}", value) + end + end + +end + +class Template + include Initializable + + def self.types + [normal, rx] + end + + def self.normal + Template.new({ + name: "Module", + generate_io: false + }) + end + + def self.rx + Template.new({ + name: "RxModule", + generate_io: true + }) + end +end + +class Interface + include Initializable + + def self.types + [xib, none, storyboard] + end + + def self.default + none + end + + def self.storyboard + Interface.new({ + name: "Storyboard", + generate_xib: false, + generate_sb: true, + wireframe_sb: true + }) + end + + def self.xib + Interface.new({ + name: "XIB", + generate_xib: true, + generate_sb: false, + wireframe_sb: false + }) + end + + def self.none + Interface.new({ + name: "None", + generate_xib: false, + generate_sb: false, + wireframe_sb: true + }) + end +end + +class Complexity + include Initializable + + def self.types + [simple, normal, hard] + end + + def self.default + normal + end + + def self.normal + Complexity.new({ + name: "Interactor", + generate_interactor: true, + generate_formatter: false + }) + end + + def self.simple + Complexity.new({ + name: "Simple", + generate_interactor: false, + generate_formatter: false + }) + end + + def self.hard + Complexity.new({ + name: "InteractorAndFormatter", + generate_interactor: true, + generate_formatter: true + }) + end +end \ No newline at end of file diff --git a/VIPER Templates/Module V1.xctemplate/TemplateInfo.plist b/VIPER Templates/Module V1.xctemplate/TemplateInfo.plist deleted file mode 100755 index f8783f0..0000000 --- a/VIPER Templates/Module V1.xctemplate/TemplateInfo.plist +++ /dev/null @@ -1,137 +0,0 @@ - - - - - DefaultCompletionName - MyModule - Description - This generates a new Module using 🐍VIPER generator. It consists of the view controller, interactor, presenter, wireframe, and an interface file. - Kind - Xcode.IDEKit.TextSubstitutionFileTemplateKind - Options - - - Description - The name of the module to create - Identifier - moduleName - Name - New Module Name: - NotPersisted - - Required - - Type - text - - - Default - ___VARIABLE_moduleName___ - Identifier - productName - Type - static - - - Default - ___VARIABLE_moduleName___Interfaces - Description - The interfaces name - Identifier - interfacesName - Name - Interfaces Name: - Required - - Type - static - - - Default - ___VARIABLE_moduleName___ViewController - Description - The view controller name - Identifier - viewControllerName - Name - View Controller Name: - Required - - Type - static - - - Default - ___VARIABLE_moduleName___Interactor - Description - The interactor name - Identifier - interactorName - Name - Interactor Name: - Required - - Type - static - - - Default - ___VARIABLE_moduleName___Presenter - Description - The presenter name - Identifier - presenterName - Name - Presenter Name: - Required - - Type - static - - - Default - ___VARIABLE_moduleName___Wireframe - Description - The wireframe name - Identifier - wireframeName - Name - Wireframe Name: - Required - - Type - static - - - Default - UIViewController - Description - What view controller class to subclass for the new module - FallbackHeader - #import <UIKit/UIKit.h> - Identifier - viewControllerSubclass - Name - Subclass of: - NotPersisted - - Required - YES - Type - class - Values - - UIViewController - - - - Platforms - - com.apple.platform.iphoneos - - SortOrder - 7 - Summary - This generates a new 🐍 VIPER module. - - diff --git a/VIPER Templates/Module V1.xctemplate/UIViewController/___FILEBASENAME___Wireframe.swift b/VIPER Templates/Module V1.xctemplate/UIViewController/___FILEBASENAME___Wireframe.swift deleted file mode 100755 index 02fac53..0000000 --- a/VIPER Templates/Module V1.xctemplate/UIViewController/___FILEBASENAME___Wireframe.swift +++ /dev/null @@ -1,43 +0,0 @@ -// -// ___FILENAME___ -// ___PROJECTNAME___ -// -// Created by ___FULLUSERNAME___ on ___DATE___. -// Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. -// -// This file was generated by the 🐍 VIPER generator -// - -import UIKit - -final class ___VARIABLE_moduleName___Wireframe: BaseWireframe { - - // MARK: - Private properties - - - private let _storyboard = UIStoryboard(name: <#Storyboard name#>, bundle: nil) - - // MARK: - Module setup - - - func configureModule(with viewController: ___VARIABLE_moduleName___ViewController) { - let interactor = ___VARIABLE_moduleName___Interactor() - let presenter = ___VARIABLE_moduleName___Presenter(wireframe: self, view: viewController, interactor: interactor) - viewController.presenter = presenter - } - - // MARK: - Transitions - - - func show(with transition: Transition, animated: Bool = true) { - let moduleViewController = _storyboard.instantiateViewController(ofType: ___VARIABLE_moduleName___ViewController.self) - configureModule(with: moduleViewController) - - show(moduleViewController, with: transition, animated: animated) - } -} - -// MARK: - Extensions - - -extension ___VARIABLE_moduleName___Wireframe: ___VARIABLE_moduleName___WireframeInterface { - - func navigate(to option: ___VARIABLE_moduleName___NavigationOption) { - } -}