ViperStackSwift
is a library, that provides mechanism for connection between VIPER modules.
Also there are some base classes and protocols for VIPER
module:
ModuleInput
ModuleOutput
ModuleRouter
ModuleView
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
.
BaseSegue
is a base class implementingSegue
protocol.PushSegue
makes a push in source viewcontroller's navigation controller.ModalSegue
presents 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?) -> ModuleOpenPromise
By 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.
To save time, you can use generamba with this module template to generate modules.
ViperStackSwift is wirtten in pure Swift.
To run the example project, clone the repo, and run pod install
from the Example directory first.
ViperStackSwift is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'ViperStackSwift'
ViperStackSwift is available under the MIT license. See the LICENSE file for more info.