修改聊天闪退
This commit is contained in:
@@ -66,9 +66,43 @@
|
||||
-(void)reloadConversationList{
|
||||
self.settingDataProvider.delegate = nil;
|
||||
self.settingDataProvider = nil;
|
||||
[_tableViewForAll removeFromSuperview];
|
||||
_tableViewForAll.delegate = nil;
|
||||
_tableViewForAll = nil;
|
||||
|
||||
TUIConversationListDataProvider *dataProvider = [[TUIConversationListDataProvider alloc] init];
|
||||
self.settingDataProvider = dataProvider;
|
||||
[_tableViewForAll setDataProvider:dataProvider];
|
||||
[self.tableViewContainer addSubview:self.tableViewForAll];
|
||||
if (self.isShowConversationGroup) {
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
NSArray *extensionList = [TUICore getExtensionList:TUICore_TUIConversationExtension_ConversationGroupListBanner_ClassicExtensionID param:nil];
|
||||
@weakify(self);
|
||||
[[[RACObserve(self, actualShowConversationGroup) distinctUntilChanged] skip:0] subscribeNext:^(NSNumber *showConversationGroup) {
|
||||
@strongify(self);
|
||||
if ([showConversationGroup boolValue]) {
|
||||
[self.tableViewContainer setFrame:CGRectMake(0, self.groupView.mm_maxY, self.view.mm_w, self.viewHeight - self.groupView.mm_maxY)];
|
||||
|
||||
self.groupItemList = [NSMutableArray array];
|
||||
[self addGroup:self.allGroupItem];
|
||||
|
||||
for (TUIExtensionInfo *info in extensionList) {
|
||||
TUIConversationGroupItem *groupItem = info.data[TUICore_TUIConversationExtension_ConversationGroupListBanner_GroupItemKey];
|
||||
if (groupItem) {
|
||||
[self addGroup:groupItem];
|
||||
}
|
||||
}
|
||||
[self onSelectGroup:self.allGroupItem];
|
||||
} else {
|
||||
self.tableViewContainer.frame = CGRectMake(0, self.bannerView.mm_maxY, self.view.mm_w, self.viewHeight - self.bannerView.mm_maxY);
|
||||
self.tableViewForAll.frame = self.tableViewContainer.bounds;
|
||||
}
|
||||
}];
|
||||
self.actualShowConversationGroup = (extensionList.count > 0);
|
||||
});
|
||||
} else {
|
||||
self.tableViewContainer.frame = CGRectMake(0, 0, self.view.mm_w, self.viewHeight - TabBar_Height-NavBar_Height-StatusBar_Height);
|
||||
self.tableViewForAll.frame = self.tableViewContainer.bounds;
|
||||
}
|
||||
}
|
||||
#pragma mark - Life Cycle
|
||||
- (void)viewDidLoad {
|
||||
|
||||
Reference in New Issue
Block a user