We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
BHModule同时通过Annotation和plist两种方式注册的没有统一到一起根据modulePriority排序,而是分别各自排序的。这里是否应该是不管用何种方式注册的,最后都统一根据modulePriority排序后放到BHModules的Array中?
我这边是这么改的,不知道是否可行?
在addModuleFromObject: shouldTriggerInitEvent:函数调用[self.BHModuleInfos addObject:moduleInfo]后把kModuleInfoPriorityKey也加到self.BHModuleInfos里去:
if ([moduleInstance respondsToSelector:@selector(modulePriority)]) { [moduleInfo setObject:@([moduleInstance modulePriority]) forKey:kModuleInfoPriority]; }
这时registedAllModules里面的self.BHModuleInfos就是完整的排过序的集合,这边的[self.BHModules addObjectsFromArray:tmpArray]改成下面的方法,直接往self.modules插入未初始化的moduleInstance,插入顺序根据self.BHModuleInfos的顺序来:
id<BHModuleProtocol> moduleInstance = [[moduleClass alloc] init]; NSUInteger index = [self.moduleInfos indexOfObject:module]; if (index == NSNotFound || index > [self.modules count]) { [self.modules addObject:moduleInstance]; } else { [self.modules insertObject:moduleInstance atIndex:index]; }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
BHModule同时通过Annotation和plist两种方式注册的没有统一到一起根据modulePriority排序,而是分别各自排序的。这里是否应该是不管用何种方式注册的,最后都统一根据modulePriority排序后放到BHModules的Array中?
我这边是这么改的,不知道是否可行?
在addModuleFromObject: shouldTriggerInitEvent:函数调用[self.BHModuleInfos addObject:moduleInfo]后把kModuleInfoPriorityKey也加到self.BHModuleInfos里去:
这时registedAllModules里面的self.BHModuleInfos就是完整的排过序的集合,这边的[self.BHModules addObjectsFromArray:tmpArray]改成下面的方法,直接往self.modules插入未初始化的moduleInstance,插入顺序根据self.BHModuleInfos的顺序来:
The text was updated successfully, but these errors were encountered: