You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When declaring views in Typhoon, I often wire in the delegate as a circular dependency. However, if using TyphoonFactoryProvider, this doesn't seem possible.
Options:
Let TyphoonFactoryProvider support this
Discourage wiring delegates this way
Example:
- (id)userProfileViewControllerFactory
{
return [TyphoonFactoryProvider withProtocol:@protocol(VBUserProfileControllerFactory) dependencies:^(TyphoonDefinition* definition)
{
[definition injectProperty:@selector(client)];
[definition injectProperty:@selector(userProfileView)];
[definition injectProperty:@selector(title) withObjectInstance:@"Settings"];
} returns:[VBUserProfileViewController class]];
}
- (id)userProfileView
{
//Normally delegate property would point back to the view controller. return [TyphoonDefinition withClass:[VBUserProfileView class]];
}
Do you have something in mind? I don’t see an automatic way to do it, if you ask me… iterate over all the definitions (currently not available at runtime), and look for a property conforming a protocol our returns: conforms too? (seems to me that it will break more than it will help).
(if we merge #180, saving the VBUserProfileView in a local variable is important).
We can always augment the API to support the simpler cases (“inject the result into this property of this dependency”), if you think it will be generally useful.
When declaring views in Typhoon, I often wire in the delegate as a circular dependency. However, if using TyphoonFactoryProvider, this doesn't seem possible.
Options:
Example:
@drodriguez ?
The text was updated successfully, but these errors were encountered: