id<NIMSessionContentConfig>config = [[NIMSessionContentConfigFactory sharedFacotry] configBy:model.message]; NSString *cellContent = [config cellContent:model.message]; return cellContent.length ? cellContent : @\"NIMSessionUnknowContentView\";
id<NIMCellLayoutConfig> layoutConfig = [[NIMKit sharedKit] layoutConfig]; NSString *identity = [layoutConfig cellContent:model]; NIMMessageCell *cell = [tableView dequeueReusableCellWithIdentifier:identity];
NIMTextContentConfig<NIMSessionContentConfig>
- (NSString *)cellContent:(NIMMessage *)message
NIMMessageType type = message.messageType; id<NIMSessionContentConfig>config = [_dict objectForKey:@(type)];
UITableViewCell *cell = nil; id model = [[self.interactor items] objectAtIndex:indexPath.row]; if ([model isKindOfClass:[NIMMessageModel class]]) { cell = [self.cellFactory cellInTable:tableView forMessageMode:model]; [(NIMMessageCell *)cell setDelegate:self.delegate]; [(NIMMessageCell *)cell refreshData:model]; // 刷新控件以及控件上的数据 } else if ([model isKindOfClass:[NIMTimestampModel class]]) { cell = [self.cellFactory cellInTable:tableView forTimeModel:model]; }
NIMMessageCellFactory
-(NIMMessageCell *)cellInTable:(UITableView *)tableView forMessageMode:(NIMMessageModel *)model
- (NIMSessionTimestampCell *)cellInTable:(UITableView *)tableView forTimeModel:(NIMTimestampModel *)model
return @\"NIMSessionTextContentView\";
NIMCellLayoutConfig<NIMCellLayoutConfig>
- (NSString *)cellContent:(NIMMessageModel *)model
NIMSessionContentConfigFactory
- (id<NIMSessionContentConfig>)configBy:(NIMMessage *)message
id<NIMSessionInteractor> interactor;id<NIMMessageCellDelegate> delegate;NIMMessageCellFactory *cellFactory
- (UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath