Skip to main content

Group Management Page

tip

This feature is supported starting from version 5.12.2.

The group management page class is RCGroupManagementViewController.

tip

Only the group owner or administrators will see the group management options in the group settings page.

Group management permissions are exclusively visible and operable by the group owner.

Initialization

Call the initialization method of the RCGroupManagementViewController class to construct the group management page.
Note: You need to create an RCGroupManagementViewModel object as the business logic handler for RCGroupManagementViewController.

Parameter Description

RCGroupManagementViewController description:

ParameterTypeDescription
viewModelRCGroupManagementViewModelThe business logic handler for RCGroupManagementViewController.

RCGroupManagementViewModel description:

ParameterTypeDescription
groupIdNSStringThe group ID.

Sample Code

NSString *groupId = @"Group ID";
RCGroupManagementViewModel *viewModel = [RCGroupManagementViewModel viewModelWithGroupId:groupId];
RCGroupManagementViewController *vc = [[RCGroupManagementViewController alloc] initWithViewModel:viewModel];
[viewController.navigationController pushViewController:vc animated:YES];

Customizing Group Management Page Cells

The data source for the group management page is RCBaseCellViewModel. Developers can refer to the logic in Customizing Cells for Current User Profile Page (Parts 1 and 2) when customizing CellViewModel. Note that custom CellViewModels should inherit from RCBaseCellViewModel.

After customizing the CellViewModel, proceed with the following steps:

1. Add RCGroupManagementViewModel Delegate

NSString *groupId = @"Group ID";
RCGroupManagementViewModel *viewModel = [RCGroupManagementViewModel viewModelWithGroupId:groupId];
/// Set the delegate
viewModel.delegate = self;

2. Modify the Data Source

- (NSArray <NSArray <RCBaseCellViewModel *> *> *)groupManagement:(RCGroupManagementViewModel *)viewModel
willLoadItemsInDataSource:(NSArray <NSArray <RCBaseCellViewModel *> *> *)dataSource {
NSMutableArray *list = dataSource.mutableCopy;
RCProfileCustomCellViewModel *customCellVM = [RCProfileCustomCellViewModel new];
customCellVM.title = @"Custom Group Management Feature";
customCellVM.detail = @"Default Value";
[list addObject:@[customCellVM]];
return list;
}

3. Customize Cell Tap Events

The cell tap events in the group management page are already implemented. Developers can intercept and customize the handling:

- (BOOL)groupManagement:(RCGroupManagementViewModel *)viewModel
viewController:(UIViewController*)viewController
tableView:(UITableView *)tableView
didSelectRow:(NSIndexPath *)indexPath
cellViewModel:(RCBaseCellViewModel *)cellViewModel {

return YES; ///YES: SDK won't handle it further. NO: SDK handles it internally.
}