Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
zhwayne authored Dec 8, 2020
2 parents df8f7f5 + 915b7c7 commit a63c6ca
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 9 deletions.
4 changes: 2 additions & 2 deletions Demo/Modules/PayService.m
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions Demo/Modules/UserService.m
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}

Expand Down
8 changes: 6 additions & 2 deletions Doc/UIKitSupport.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

## 局限性

只有在响应链建立完成了才能分发事件,所以适合处理用户触摸产生,不适合其他逻辑场景。


2 changes: 1 addition & 1 deletion QTEventBus.podspec
Original file line number Diff line number Diff line change
@@ -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
优雅的处理全局事件,类型安全,支持同步/异步发送,同步/异步监听
Expand Down
2 changes: 1 addition & 1 deletion Sources/AppModule/QTAppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion Sources/AppModule/QTAppModule.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#pragma mark - 常用

/// 启动
- (void)appDidFinishLuanch:(QTAppDidLaunchEvent *)event;
- (void)appDidFinishLaunch:(QTAppDidLaunchEvent *)event;

/// App全部的模块已初始化
- (void)appAllModuleInit:(QTAppAllModuleInitEvent *)event;
Expand Down
1 change: 1 addition & 0 deletions Sources/Core/QTEventBusCollection.m
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ - (void)removeNodeForId:(NSString *)uniqueId{
node.previous = nil;
previousNode.next = nextNode;
nextNode.previous = previousNode;
[_registeredNodeTable removeObjectForKey:uniqueId];
}

- (void)appendNode:(_QTEventBusLinkNode *)node{
Expand Down

0 comments on commit a63c6ca

Please sign in to comment.