测试已测试 | ✗ |
语言编程语言 | SwiftSwift |
许可证 | MIT |
发布日期最后一次发布 | 2016 年 8 月 |
SPM支持 SPM | ✗ |
由 xtrinch 维护。
允许您从用户的通讯录中选择多个联系人。在按钮按下时将所选联系人返回给指定的代理。没有搜索功能,颜色不能编辑,但我将非常乐意接受拉取请求。
要运行示例项目,请克隆仓库,然后首先从 Example 目录中运行 pod install
。
import MRMultipleContactPicker
import UIKit
class ViewController: UIViewController, MRMultipleContactPickerDelegate {
@IBAction func showContactsTapped(sender: AnyObject) {
displayContactPicker()
}
func displayContactPicker() {
let podBundle = NSBundle(forClass: MRMultipleContactPickerController.self)
let bundleURL = podBundle.URLForResource("MRMultipleContactPicker", withExtension: "bundle")
let bundle = NSBundle(URL: bundleURL!)!
let s = UIStoryboard (
name: "Main", bundle: bundle
)
let vc = s.instantiateInitialViewController()!
(vc as! MRMultipleContactPickerController).delegate = self
(vc as! MRMultipleContactPickerController).titleText = "Choose"
self.presentViewController(vc, animated: true, completion: nil)
}
// MARK: MRMultipleContactPickerDelegate methods
func contactsSelected(people:[Person]) {
print(people)
}
}
MRMultipleContactPicker 可以通过 CocoaPods 获取。要安装它,只需将以下行添加到 Podfile 中:
pod "MRMultipleContactPicker"
xTrinch, [email protected]
MRMultipleContactPicker 可在 MIT 许可下获得。有关更多信息,请参阅 LICENSE 文件。