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

Block definitions #475

Merged
merged 30 commits into from
Feb 8, 2016
Merged

Conversation

nickynick
Copy link
Contributor

This is the implementation of an idea from #467. Please see TyphoonBlockDefinition for details :) There is already a bunch of tests for this - not sure if that's enough, but it's something to begin with. I'll be adding some docs shortly.

As a bonus, I also felt entitled to do some cleanup & reorganizing. In particular, all infrastructure-related stuff was moved from Typhoon.h umbrella header to Typhoon+Infrastructure.h. I feel like that's the way to go with all the stuff which is not intended for basic usage.

@@ -30,4 +32,13 @@ - (id)anotherKnight
}];
}

- (id)blockKnight
{
return [TyphoonBlockDefinition withClass:[Knight class] block:^id{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is duplication of Knight class reference intentional? I mean, it's being used there and later in [[Knight alloc] init].

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. We need to know the component type beforehand so Typhoon would be able to use this definition for auto-injections and injections by property type.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@jasperblues
Copy link
Member

Thank you @nickynick

@etolstoy
Copy link
Contributor

etolstoy commented Feb 8, 2016

Congrats! A great feature!

@nickynick
Copy link
Contributor Author

🎉 🍻 Thanks! I'll get on docs and stuff like that shortly.

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

Successfully merging this pull request may close these issues.

4 participants