Skip to main content

Group managers page

The group managers page class is NCGroupManagerListController

Initialize

Call the initialization method of NCGroupManagerListController to create a group managers page. Note that you need to create an NCGroupManagerListViewModel object as the business logic handler for NCGroupManagerListController.

Parameters

NCGroupManagerListController parameters:

ParameterTypeDescription
viewModelNCGroupManagerListViewModelThe business logic handler for NCGroupManagerListController.

NCGroupManagerListViewModel parameters:

ParameterTypeDescription
groupIdNSStringThe group channel ID

Example code

Objective C
NSString *groupId = @"Group ID";
NCGroupManagerListViewModel *viewModel = [NCGroupManagerListViewModel viewModelWithGroupId:groupId];
NCGroupManagerListController *vc = [[NCGroupManagerListController alloc] initWithViewModel:viewModel];
[viewController.navigationController pushViewController:vc animated:YES];

Customization

You can customize click events on the group managers page through NCGroupManagerListViewModel delegate methods:

1. Add NCGroupManagerListViewModel delegate

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

2. Implement NCGroupManagerListViewModel delegate methods

Customize cell click events:

Objective C
- (BOOL)  groupManagers:(NCGroupManagerListViewModel *)viewModel
viewController:(UIViewController*)viewController
tableView:(UITableView *)tableView
didSelectRow:(NSIndexPath *)indexPath
cellViewModel:(NCBaseCellViewModel *)cellViewModel {

return YES;///YES: SDK won't handle, NO: SDK handles
}

Customize manager removal events:

Objective C
- (BOOL)groupManagersWillRemove:(NSString *)groupId
removeUserIds:(NSArray <NSString *>*)removeUserIds
viewController:(UIViewController*)viewController {

return YES;///YES: SDK won't handle, NO: SDK handles
}