集成通讯录界面
更新时间: 2024/03/15 18:26:21
本文主要介绍如何构建通讯录界面。
IM UIKit 提供基于 UITableview 实现的通讯录界面,其类名为 ContactsViewController
,并提供多个分组。
通讯录界面使用简单,无需外部传参,使用时直接实例化即可。
同时 IM UIKit 还支持从其他界面跳转至通讯录界面以及跳转到对应的信息名片页。
方法原型
Swift
let user = User.init()
let userInfoVC = ContactUserViewController(user: user)
self.navigationController?.pushViewController(userInfoVC, animated: true)
Objective-C
User *user = [[User alloc] init];
ContactUserViewController *userInfoVC = [[ContactUserViewController alloc] initWithUser:user];
[self.navigationController pushViewController:userInfoVC animated:YES];
参数说明
参数 | 类型 | 说明 |
---|---|---|
user | NIMUser |
云信用户,包含用户 ID 等信息 |
代码示例
Swift
let contactVC = ContactsViewController()
let contactsNav = NENavigationController(rootViewController: contactVC)
Objective-C
ContactsViewController *contactVC = [[ContactsViewController alloc] init];
UINavigationController *contactsNav = [[UINavigationController alloc] initWithRootViewController:contactVC];
此文档是否对你有帮助?