一个现代的、高度可定制的联系人选取器,具有多选选项
EYContactsPicker
一款模仿了 ContactsUI 中的 CNContactPickerViewController 行为的现代、可高度自定义且具有多选选项的联系人选择器。
预览
深色模式 | 白色模式 |
---|---|
安装
CocoaPods
将其添加到 Podfile 以获取最新版本
pod 'EYContactsPicker'
或指定所需的版本
pod 'EYContactsPicker', '~> 1.0.0'
手动安装
下载并包含代码库中的 EYContactsPicker
文件夹和文件。
要求
- iOS 12+
- Swift 5
特性
EYContactsPicker is a modern, customisable and easy to use Contacts Picker similar to the stock CNContactPickerViewController. It does improve in a couple of area for a better UX.
确保你的应用(主机应用)在 Info.plist
中提供了 Privacy - Contacts Usage Description
。
我们还建议你检查是否授予了联系人授权。
如何使用
// This is in your application
var theme = PickerTheme()
theme.tintColor = .green
let vc = PickContactsViewController(title: "test", description: "test description", pickerType: .list, country: .all , totalSelection: 100, theme: theme , isRTL: false) { contacts in
for conatact in contacts {
print(conatact.name ?? "")
print(conatact.phoneNumber)
}
}
self.present(vc, animated: true)