Mwx
public class Mwx
The main interface for exposing and wrapping up the framework with set of functions for type register and resolve
-
Call this static function to register a type in the current component context store using SwiftDI injection engine.
Declaration
Swift
public static func register<T>(_ initialize: @escaping () -> T) -> DIComponentContext<T>
Parameters
initialize
A
() -> T
indicates the initialization closure of type inferred asT
.Return Value
The component context of the registered type.
-
Call this static function to resolve a type from the current component context store using SwiftDI injection engine.
Declaration
Swift
public static func resolve<T>(_ type: T.Type) -> T
Parameters
type
A
T.Type
indicates the type being resolvedReturn Value
An instance of the type resolved from component store.