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

NSNotificationCenter binding #1

Open
K-Be opened this issue Apr 30, 2014 · 2 comments
Open

NSNotificationCenter binding #1

K-Be opened this issue Apr 30, 2014 · 2 comments

Comments

@K-Be
Copy link

K-Be commented Apr 30, 2014

Hi.
What do you think about binding blocks with NSNotification events?

@jeremytregunna
Copy link
Owner

I'd be open to seeing that, what are your thoughts on making that work?

@K-Be
Copy link
Author

K-Be commented May 14, 2014

Sorry, my english is not very well.
I think it should be something like this:

[bind bindNotificationWithName:(NSString*)notificationName object:(id)object withBlock:(void(^)(NSNotification* notification))handler]; // main notification center
[bind bindNotificationWithName:(NSString*)notificationName object:(id)object notificationCenter:(NSNotificationCenter*)notificationCenter withBlock:(void(^)(NSNotification*))handler];
[bind bindNotificationWithName:(NSString*)notificationName withBlock:(void(^)(NSNotification*))handler]; //any object, main notification center

Bind should work like proxy object and redirect notifications to the handlers.
Bind should look after double subscriptions and unsubscriptions.

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

No branches or pull requests

2 participants