联系人列表为空 | 联系人列表非空 |
![]() | ![]() |
TUIKit
或 TUIContact
。TUILogin
的 login
接口登录组件。TUIContactController
对象并显示出来即可。#import "TUIContactController_Minimalist.h"// ContactController is your own ViewController@implementation ContactController- (void)viewDidLoad {// Create TUIContactController_MinimalistTUIContactController_Minimalist *vc = [[TUIContactController_Minimalist alloc] init];// Option 1: push vc.[self.navigationController pushViewController:vc animated:YES];// Option 2: add vc to your own ViewController.// [self addChildViewController:vc];// [self.view addSubview:vc.view];}@end
#import "TUIContactController.h"// ContactController is your own ViewController@implementation ContactController- (void)viewDidLoad {// Create TUIContactControllerTUIContactController *vc = [[TUIContactController alloc] init];// Option 1: push vc.[self.navigationController pushViewController:vc animated:YES];// Option 2: add vc to your own ViewController.// [self addChildViewController:vc];// [self.view addSubview:vc.view];}@end
TUIContact
对该界面的点击行为做了默认处理,如下:动作 | 效果 |
点击 New Contacts | 展示未处理的加好友请求 |
点击 Group Chats | 展示当前登录账号的所有群聊 |
点击 Blocked List | 展示当前登录账号的黑名单 |
点击联系人头像 | 进入联系人管理界面 |
点击右上角界面 + 号 | 弹出 Add to Contacts ,Add Group 菜单 |
Add to Contacts
、点击 Group Chats
的行为,您可以通过实现 TUIContactControllerListener
中的方法自定义:@protocol TUIContactControllerListener_Minimalist <NSObject>@optional- (void)onSelectFriend:(TUICommonContactCell *)cell;- (void)onAddNewFriend:(TUICommonTableViewCell *)cell;- (void)onGroupConversation:(TUICommonTableViewCell *)cell;@end
@protocol TUIContactControllerListener <NSObject>@optional- (void)onSelectFriend:(TUICommonContactCell *)cell;- (void)onAddNewFriend:(TUICommonTableViewCell *)cell;- (void)onGroupConversation:(TUICommonTableViewCell *)cell;@end
本页内容是否解决了您的问题?