Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TyphoonDefinition allow callback block after building? #258

Closed
jasperblues opened this issue Sep 19, 2014 · 2 comments
Closed

TyphoonDefinition allow callback block after building? #258

jasperblues opened this issue Sep 19, 2014 · 2 comments
Labels

Comments

@jasperblues
Copy link
Member

This one has been raised before, and decided against.

Occasionally I have a component that requires config to be called after building it. Example:

  /** - - - - - - - - - - - > > > - - - - - - - - - - - - - [Configure Readers Array and Profiles] */
    // Load DMSDK readers configuration from JSON resource file
    //
    NSString *configFile = @"DMSReadersConfig";

    NSBundle *bundle = [NSBundle bundleForClass:[self class]];
    NSString *cfg = [bundle pathForResource:configFile ofType:@"json"];
    [self.dmsManager loadReadersConfigFromJSONFile:cfg];

Usually I would define a category method on the class, and set:

definition.afterPropertyInjection=@selector(loadConfig)

But should we allow a callback block to be defined on Typhoon definition?

@alexgarbarev
Copy link
Contributor

Can it be done by this #264?

@jasperblues
Copy link
Member Author

It could, but in this case I was referring to a block that could be defined on the assembly, if for some reason it makes sense to have it there, and not in the class itself.

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

No branches or pull requests

2 participants