Skip to content

Argument injection with Tag or Name

Compare
Choose a tag to compare
@ivlevAstef ivlevAstef released this 23 Jun 08:45
· 18 commits to master since this release

Fix argument injection for Tag and named resolve. for example:

container.register { MyClass(inj: arg($0)) }
    .as(name: "Name", MyProtocol.self)
    .as(tag: MyTag.self, MyProtocol.self)
let arg = AnyArgument(type: MyProtocol.self, value: 1)
let obj1: MyProtocol = container.resolve(name: "Name", arguments: arg)
let obj2: MyProtocol = by(tag: MyTag.self, on: container.resolve(arguments: arg))