ViperStackSwift
What is it?
ViperStackSwift is a library, that provides mechanism for connection between VIPER modules.
Also there are some base classes and protocols for VIPER module:
ModuleInputModuleOutputModuleRouterModuleView
With this library you can navigate between modules objects named Segues.
Segue is an object, that can customize opening UIViewController and it's animation.
Segues are presented with protocol Segue.
BaseSegueis a base class implementingSegueprotocol.PushSeguemakes a push in source viewcontroller's navigation controller.ModalSeguepresents destination viewcontroller as modal.
To customize showing UIViewController, you should make a subclass of BaseSegue and override perform and unwind methods.
To perform a segue, create a Segue object, and call from your transitionHandler:
openModule(withSegue segue: Segue?, linkClosure closure: ModuleLinkClosure?) -> ModuleOpenPromiseBy default you should use UIViewController for transitionHandler, there is an extension for it.
linkClosure is needed to connect parent module as moduleOutput with child module. In linkClosure you also can call some methods from child module, for example, pass a parameter from parent to child.
Lifehack
To save time, you can use generamba with this module template to generate modules.
Language
ViperStackSwift is wirtten in pure Swift.
Example
To run the example project, clone the repo, and run pod install from the Example directory first.
Requirements
Installation
ViperStackSwift is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'ViperStackSwift'Author
License
ViperStackSwift is available under the MIT license. See the LICENSE file for more info.