
基础产品
适用各种通信场景,接入灵活

融合场景
专为场景打造,接入成本低

扩展能力
核心能力延展,功能全面

更多服务
一站式服务,满足各种需求
回答:
重写 UITableView 的代理方法,实现“置顶”和“删除”功能。(由于重写代理方法,SDK 父类中的“删除”功能失效)
- (NSArray *)tableView:(UITableView *)tableView editActionsForRowAtIndexPath:(NSIndexPath *)indexPath { RCConversationModel *model = self.conversationListDataSource[indexPath.row]; NSString *topStr = @"置顶"; if (model.isTop == YES) { topStr = @"取消置顶"; } __weak typeof(self) __weakself = self; UITableViewRowAction *action0 = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleNormal title:topStr handler:^(UITableViewRowAction *action, NSIndexPath *indexPath) { BOOL isSuccess = [[RCIMClient sharedRCIMClient] setConversationToTop:model.conversationType targetId:model.targetId isTop:!model.isTop]; [__weakself refreshUI:isSuccess]; }]; action0.backgroundColor = [UIColor orangeColor]; UITableViewRowAction *action1 = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDefault title:@"删除" handler:^(UITableViewRowAction *action, NSIndexPath *indexPath) { BOOL isSuccess = [[RCIMClient sharedRCIMClient] removeConversation:model.conversationType targetId:model.targetId]; [__weakself refreshUI:isSuccess]; }]; return @[action1, action0]; } - (void)refreshUI:(BOOL)isSuccess { __weak typeof(self) __weakself = self; if (isSuccess) { [__weakself refreshConversationTableViewIfNeeded]; } else { NSLog(@"操作失败"); } }
效果图: