diff --git a/Demo/Modules/PayService.m b/Demo/Modules/PayService.m index 216258d..257d5c2 100644 --- a/Demo/Modules/PayService.m +++ b/Demo/Modules/PayService.m @@ -21,8 +21,8 @@ @implementation PayService return [[PayService alloc] init]; } -- (void)appDidFinishLuanch:(QTAppDidLaunchEvent *)event{ - NSLog(@"PayService: appDidFinishLuanch"); +- (void)appDidFinishLaunch:(QTAppDidLaunchEvent *)event{ + NSLog(@"PayService: appDidFinishLaunch"); } @end diff --git a/Demo/Modules/UserService.m b/Demo/Modules/UserService.m index 9190421..42e4f90 100644 --- a/Demo/Modules/UserService.m +++ b/Demo/Modules/UserService.m @@ -36,8 +36,8 @@ - (void)registerEventObserver{ return [UserService shared]; } -- (void)appDidFinishLuanch:(QTAppDidLaunchEvent *)event{ - NSLog(@"UserService: appDidFinishLuanch"); +- (void)appDidFinishLaunch:(QTAppDidLaunchEvent *)event{ + NSLog(@"UserService: appDidFinishLaunch"); [[UserService shared] registerEventObserver]; } diff --git a/Doc/UIKitSupport.md b/Doc/UIKitSupport.md index 8c5e105..0f4be1a 100644 --- a/Doc/UIKitSupport.md +++ b/Doc/UIKitSupport.md @@ -44,8 +44,12 @@ Controller作为EventBus的提供者,View和Controller都可以通过属性`ev ## FAQ -1. ChildViewController如何和ParentViewController通信? +ChildViewController如何和ParentViewController通信? -将ChildViewController的`isDispatcherProvider`属性设置为NO。 +将ChildViewController的`isDispatcherProvider`属性设置为NO。这样EventBus在寻找`eventDispatcher`的时候会忽略这个controller,从而找到parentController + +## 局限性 + +只有在响应链建立完成了才能分发事件,所以适合处理用户触摸产生,不适合其他逻辑场景。 diff --git a/QTEventBus.podspec b/QTEventBus.podspec index 5c67ee5..83416f3 100644 --- a/QTEventBus.podspec +++ b/QTEventBus.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'QTEventBus' - s.version = '0.4.0' + s.version = '0.4.1' s.summary = '优雅的处理全局事件' s.description = <<-DESC 优雅的处理全局事件,类型安全,支持同步/异步发送,同步/异步监听 diff --git a/Sources/AppModule/QTAppDelegate.m b/Sources/AppModule/QTAppDelegate.m index 5aaf453..ef22131 100644 --- a/Sources/AppModule/QTAppDelegate.m +++ b/Sources/AppModule/QTAppDelegate.m @@ -24,7 +24,7 @@ @implementation QTAppDelegate - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{ QTAppDidLaunchEvent * event = [[QTAppDidLaunchEvent alloc] init]; event.launchOptions = launchOptions; - [self _sendEvent:event sel:@selector(appDidFinishLuanch:)]; + [self _sendEvent:event sel:@selector(appDidFinishLaunch:)]; QTAppAllModuleInitEvent * initEvent = [[QTAppAllModuleInitEvent alloc] init]; [self _sendEvent:initEvent sel:@selector(appAllModuleInit:)]; return YES; diff --git a/Sources/AppModule/QTAppModule.h b/Sources/AppModule/QTAppModule.h index 9aeca06..2719462 100644 --- a/Sources/AppModule/QTAppModule.h +++ b/Sources/AppModule/QTAppModule.h @@ -21,7 +21,7 @@ #pragma mark - 常用 /// 启动 -- (void)appDidFinishLuanch:(QTAppDidLaunchEvent *)event; +- (void)appDidFinishLaunch:(QTAppDidLaunchEvent *)event; /// App全部的模块已初始化 - (void)appAllModuleInit:(QTAppAllModuleInitEvent *)event; diff --git a/Sources/Core/QTEventBusCollection.m b/Sources/Core/QTEventBusCollection.m index b6b9943..74a4c6b 100644 --- a/Sources/Core/QTEventBusCollection.m +++ b/Sources/Core/QTEventBusCollection.m @@ -89,6 +89,7 @@ - (void)removeNodeForId:(NSString *)uniqueId{ node.previous = nil; previousNode.next = nextNode; nextNode.previous = previousNode; + [_registeredNodeTable removeObjectForKey:uniqueId]; } - (void)appendNode:(_QTEventBusLinkNode *)node{