DIExtensions
public class DIExtensions
сlass to extend possible actions related to object creation
-
method for setting arguments injected into an object. Example:
container.register{ YourClass(p1: $0, p2: arg($2)) } .injection{ $0.property = arg($1) } ... container.extension(for: YourClass.self).setArgs(15, "it's work!") let yourClass = *container // p1 - injected, p2 = 15, property = "it's work!"
Declaration
Swift
public func setArgs(_ args: Any?...)
Parameters
args
array of arguments