群管理页面
提示
此功能在 5.12.2 版本开始支持。
群管理页面类是 RCGroupManagementViewController。
提示
只有群主或者管理员才会在群设置页显示群管理项。
群管理权限只有群主可以显示和操作。
初始化
调用 RCGroupManagementViewController 类的初始化方法构建群管理页面。
注意,您需要创建一个 RCGroupManagementViewModel 对象, 作为 RCGroupManagementViewController 的业务逻辑处理模块。
参数说明
RCGroupManagementViewController 说明:
| 参数 | 类型 | 说明 |
|---|---|---|
| viewModel | RCGroupManagementViewModel | RCGroupManagementViewController 的业务逻辑处理。 |
RCGroupManagementViewModel 说明:
| 参数 | 类型 | 说明 |
|---|---|---|
| groupId | NSString | 群组 id |
示例代码
Objective C
NSString *groupId = @"群组 Id";
RCGroupManagementViewModel *viewModel = [RCGroupManagementViewModel viewModelWithGroupId:groupId];
RCGroupManagementViewController *vc = [[RCGroupManagementViewController alloc] initWithViewModel:viewModel];
[viewController.navigationController pushViewController:vc animated:YES];
自定义群管理页面 cell
群管理页面的数据源是 RCBaseCellViewModel, 开发者自定义CellViewModel 可参考当前用户资料页自定义 cell 1、2 部分逻辑, 注意自定义 CellViewModel 改为继承RCBaseCellViewModel
自定义 CellViewModel 后,参考下面示例继续进行自定义操作:
1. 添加 RCGroupManagementViewModel 代理
Objective C
NSString *groupId = @"群组 Id";
RCGroupManagementViewModel *viewModel = [RCGroupManagementViewModel viewModelWithGroupId:groupId];
/// 设置代理
viewModel.delegate = self;