Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Module infrastructure
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
You can’t perform that action at this time.