更新时间: 2021-03-08
# 数据相关
# 收到新消息
参数说明:
参数 | 类型 | 说明 |
---|---|---|
notification | NSNotification (opens new window) | 收到新消息的 notification |
回调原型:
- (void)didReceiveMessageNotification:(NSNotification *)notification;
已复制
1
SDK 在此方法中有针对消息接收有默认的处理(如刷新等),如果开发者重写此方法,请注意调用 super。
# 删除会话
参数说明:
参数 | 类型 | 说明 |
---|---|---|
model | RCConversationModel (opens new window) | 会话 Cell 的数据模型 |
回调原型:
- (void)didDeleteConversationCell:(RCConversationModel *)model;
已复制
1
# 即将加载数据源
您可以在回调中修改、添加、删除数据源的元素来定制显示的内容,会话列表会根据您返回的修改后的数据源进行显示。数据源中存放的元素为会话 Cell 的数据模型,即RCConversationModel对象。
参数说明:
传入参数说明:
参数 | 类型 | 说明 |
---|---|---|
dataSource | NSMutableArray | 即将加载的增量数据源 |
返回参数说明:
参数 | 类型 | 说明 |
---|---|---|
dataSource | NSMutableArray | 修改后的数据源 |
回调原型:
- (NSMutableArray *)willReloadTableData:(NSMutableArray *)dataSource;
已复制
1
2.9.21 及其以前版本,dataSource 为全量数据,conversationListDataSource = dataSource
2.9.22 及其以后版本,dataSource 为增量数据,conversationListDataSource += dataSource,如果需要更改全量数据的内容,可以更改 conversationListDataSource
# 即将更新未读消息数
当收到消息或删除会话时,会调用此回调,您可以在此回调中执行未读消息数相关的操作。
回调原型:
- (void)notifyUpdateUnreadMessageCount;
已复制
1
该方法在非主线程回调,如果想在本方法中操作 UI,请手动切换到主线程。
# Cell 显示
# 即将显示 Cell
开发者可以在此回调中修改 Cell 的一些显示属性。会话列表自带 Cell 样式如字体颜色,字体大小的修改,不建议修改 Cell 的布局,如果对 UI比较高的定制需求,建议自定义会话列表 Cell。
参数说明:
参数 | 类型 | 说明 |
---|---|---|
cell | RCConversationBaseCell (opens new window) | 即将显示的 Cell |
indexPath | NSIndexPath | 该 Cell 对应的会话 Cell 数据模型在数据源中的索引值 |
回调原型:
- (void)willDisplayConversationTableCell:(RCConversationBaseCell *)cell atIndexPath:(NSIndexPath *)indexPath;
已复制
1
数据源中存放的元素为会话 Cell 的数据模型,即 RCConversationModel (opens new window) 对象。
# Cell 点击
# 点击 Cell
参数说明:
参数 | 类型 | 说明 |
---|---|---|
conversationModelType | RCConversationModelType (opens new window) | 当前点击的会话的 Model 类型 |
model | RCConversationModel (opens new window) | 当前点击的会话的 Model |
indexPath | NSIndexPath | 当前会话在列表数据源中的索引值 |
回调原型:
- (void)onSelectedTableRow:(RCConversationModelType)conversationModelType conversationModel:(RCConversationModel *)model atIndexPath:(NSIndexPath *)indexPath;
已复制
1
2
3
2
3
# 点击头像
参数说明:
参数 | 类型 | 说明 |
---|---|---|
model | RCConversationModel (opens new window) | 会话 Cell 的数据模型 |
回调原型:
- (void)didTapCellPortrait:(RCConversationModel *)model;
已复制
1
# 长按头像
参数说明:
参数 | 类型 | 说明 |
---|---|---|
model | RCConversationModel (opens new window) | 会话 Cell 的数据模型 |
回调原型:
- (void)didLongPressCellPortrait:(RCConversationModel *)model;
已复制
1
# 自定义 Cell
# 自定义会话 Cell 显示
参数说明:
参数 | 类型 | 说明 |
---|---|---|
tableView | UITableView | 当前TabelView |
indexPath | NSIndexPath | 该 Cell 对应的会话 Cell 数据模型在数据源中的索引值 |
返回参数说明
参数 | 类型 | 说明 |
---|---|---|
dataSource | RCConversationBaseCell (opens new window) | 自定义会话需要显示的Cell |
回调原型:
- (RCConversationBaseCell *)rcConversationListTableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath;
已复制
1
2
2
# 左滑删除自定义会话
参数说明:
参数 | 类型 | 说明 |
---|---|---|
tableView | UITableView | 当前TabelView |
editingStyle | UITableViewCellEditingStyle | 当前的 Cell操作,默认为UITableViewCellEditingStyleDelete |
indexPath | NSIndexPath | 该 Cell 对应的会话 Cell 数据模型在数据源中的索引值 |
回调原型:
- (void)rcConversationListTableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath;
已复制
1
2
3
2
3