OCEventBus

an eventbus implementation for ios developer

5
1
Objective-C

OCEventBus

an eventbus implementation for ios developer
#usage

  1. import library
#import "NSObject+eventbus.h"
  1. create event types
typedef enum{
    sample_event_user_login,
    sample_event_user_logout
} sample_event_t;
  1. register event listenner
[self onEvent:sample_event_user_login cb:^(id sender,id ud){
    NSLog(@"sample event useradata:%@",ud);
}
``
4. post event 
```objc
[self postEvent:sample_event_user_login obj:nil];
  1. unregister
[self unregisterEvent:sample_event_userlogin];