FlowElementContainer
public class FlowElementContainer<T>
The idea of have FlowElementContainer is a way of have the reference encapsulated inside a object that we can manage the reference to our real object, as we will be using this inside an array, we need to be able to destroy easily our array without have the risk of some view controller hold the reference to the object
-
Enum that will say which type of the registration you want to your instance
Declaration
Swift
public enum Scope -
Typealias
Declaration
Swift
public typealias Container = () -> T? -
Flow element container initialiser
Declaration
Swift
public init(for type: T.Type, resolving: @escaping Container)Parameters
forThe type of the View Controller that you want to register.
resolvingIs the closure that will be called when Flow Manager need to get the instance of the type that you declared
-
Flow element container initialiser
Declaration
Swift
public init(for type: T.Type, customIdentifier: String, resolving: @escaping Container)Parameters
forThe type of the View Controller that you want to register.
customIdentifierString that is custom identifier to identify particular view
resolvingIs the closure that will be called when Flow Manager need to get the instance of the type that you declared
-
Flow element container initialiser for when you want to resolving receiving the parameters from the caller
Declaration
Swift
public init(for type: T.Type, with arg: Any, resolving: CallbackFunctionType)Parameters
forThe type of the View Controller that you want to register.
withThe arguments that you will want to have,
Anyas type.resolvingIs the closure that will be called when Flow Manager need to get the instance of the type that you declared.
-
Flow element container initialiser for when you want to resolving receiving the parameters from the caller
Declaration
Swift
public init(for type: T.Type, customIdentifier: String, with arg: Any, resolving: CallbackFunctionType)Parameters
forThe type of the View Controller that you want to register.
customIdentifierString that is custom identifier to identify particular view
withThe arguments that you will want to have,
Anyas type.resolvingIs the closure that will be called when Flow Manager need to get the instance of the type that you declared.
-
Set the scope that we will want for this object
Note
It has
@discardableResultbecause you can use other helper methods just after calling this method as we always return FlowElementContainer instance.Declaration
Swift
@discardableResult public func inScope(scope: Scope) -> SelfParameters
scopeThe scope that you want to have your instance reference,
.weak,.strong, or default is.none -
Return the type of this element
Declaration
Swift
public func type() -> T.Type -
Return the identifier of this element
Declaration
Swift
public func identifier() -> String?
FlowElementContainer Class Reference