Created
May 14, 2018 13:42
-
-
Save poksi592/138e5c87b2e6cf047fb11f99aba57c85 to your computer and use it in GitHub Desktop.
Module infrastructure
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public typealias ModuleParameters = [String: String] | |
/** | |
Application module represents a group off all the classes that implement a certain functionality of the module, like: | |
- Storyboard | |
- View Controllers | |
- Views, specific to the module | |
- Presenters, View Models and other Client architecture classes | |
- ... | |
Every module needs to identify itself with unique application route/domain which is queried by `ModuleHub` | |
*/ | |
protocol ModuleType { | |
/** | |
Every module needs to identify itself with a certain route/domain | |
- returns: | |
String that represents the route, domain, like _"/module-name"_ | |
*/ | |
var route: String { get } | |
var paths: [String] { get } | |
/** | |
Function has to implement start of the module | |
- parameters: | |
- parameters: Simple dictionary of parameters | |
- path: Path which is later recognised by specific module and converted to possible method | |
*/ | |
func open(parameters: ModuleParameters?, | |
path: String?, | |
callback: ModuleCallback?) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment