Skip to content
This repository has been archived by the owner on Jan 2, 2021. It is now read-only.

Is it possible to inject using "useInitializer" when method includes swift pure protocols? #11

Closed
claudioredi opened this issue Aug 20, 2015 · 1 comment

Comments

@claudioredi
Copy link

I have the following initializer

 init(database: DatabaseProtocol, deserializerFactory: DeserializerFactory ) {
        self.database = database
        self.deserializerFactory = deserializerFactory
}

and I try to inject parameters using

definition.useInitializer("initWithDatabase:deserializerFactory:") {
         (initializer) in
                
         initializer.injectParameterWith(self.dataStoreAssembly.database())
         initializer.injectParameterWith(self.dataStoreAssembly.deserializerFactory())
}

So far I understand, I should add @objc to DatabaseProtocol. Problem is that I can't do this since it has members that can't be represented in objective c

@claudioredi claudioredi changed the title Is it possible to inject using "useInitializer" when constructor has swift pure protocol? Is it possible to inject using "useInitializer" when method includes swift pure protocols? Aug 20, 2015
@claudioredi
Copy link
Author

Moved this to Typhoon repo since created it here by mistake

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants