1
votes

When I try to inject parameters using the following method, the Xcode compiler says it cannot invoke this method. It works fine if I remove the configuration parameter. Xcode intellisense doesn't list out this method either. Am I missing something thing here?

enter image description here

1

1 Answers

0
votes

Here's an example of using a factory component with trailing closure syntax. Just about all of the TyphoonDefinition methods have the block/closure as the last parameter, so you can use the traling closure syntax. I find this a little easier to read in Swift.

public dynamic func motherOfKnights() -> AnyObject {
    return TyphoonDefinition.withClass(MotherOfKnights.self)
}

public dynamic func brandNewBabyKnight() -> AnyObject {
    return TyphoonDefinition.withFactory(self.motherOfKnights(), 
      selector: "makeKnight:") {
        (factoryMethod) in

        factoryMethod.injectParameterWith("Robert")
    }
}