ios - 在tableView上显示数据: Calling contacts from a picker to tableView 29 and counting

标签 ios swift uitableview contacts picker

无论如何,我想问一下是否可以从我的联系人选择器中填充表格 View 。我正在使用这个库:https://github.com/ipraba/EPContactsPicker

这是我的选择器:

///CONTACTS PICKER\\\

@IBAction func onTouchShowMeContactsButton(sender: AnyObject) {

    let contactPickerScene = EPContactsPicker(delegate: self, multiSelection:true, subtitleCellType: SubtitleCellValue.Email)
    let navigationController = UINavigationController(rootViewController: contactPickerScene)
    self.presentViewController(navigationController, animated: true, completion: nil)

}

//MARK: EPContactsPicker delegates
func epContactPicker(_: EPContactsPicker, didContactFetchFailed error : NSError)
{
    print("Failed with error \(error.description)")
}

func epContactPicker(_: EPContactsPicker, didSelectContact contact : EPContact)
{
    print("Contact \(contact.displayName()) has been selected")
}

func epContactPicker(_: EPContactsPicker, didCancel error : NSError)
{
    print("User canceled the selection");
}

func epContactPicker(_: EPContactsPicker, didSelectMultipleContacts contacts: [EPContact]) {
    print("The following contacts are selected")
    for contact in contacts {
        print("\(contact.displayName())")
    }

选择联系人后,我希望能够在表格 View 上显示它们,如下所示:TableView

如果没有答案,或者如果你们认为我由于缺乏经验而不值得帮助,请通过某种教程或任何某种相关信息向我发送帮助。 感谢大家付出的时间和精力。 <3

最佳答案

要从手机获取联系方式,您可以使用苹果库,ABAddressBookRef

Please check the apple documentation

关于ios - 在tableView上显示数据: Calling contacts from a picker to tableView 29 and counting,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34981392/

相关文章:

ios - iphone-如何在 ios 中不导航消息窗口的情况下发送 SMS [未重复]

ios - 如何查看应用程序在未连接的情况下运行时遇到的错误?

ios - TableViewCell 不要重用

ios - 全局计算属性线程安全吗?

ios - UITableViewController 嵌入到另一个 UIView 的容器中时不显示内容

IOS tableview 在下载新图像问题时重用旧图像

ios - 就地 UITableView 编辑 : Adding a row crash

ios - DispatchQueue vs 委托(delegate) vs Swift 中的闭包

Swift 3 从 url 搜索表

ios - 单击按钮并更改其图像时的 UITableView Swift 4