在tableView上显示数据:将联系人从选择器调用到tableView 29并进行计数 [英] Displaying data on a tableView: Calling contacts from a picker to tableView 29 and counting

查看:88
本文介绍了在tableView上显示数据:将联系人从选择器调用到tableView 29并进行计数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Aaanyway,我想问一下是否有可能从我的联系人选择器中填充表格视图.我正在使用此库: https://github.com/ipraba/EPContactsPicker

Aaanyway, I wanted to ask if its possible to populate a table view from my contacts picker. I'm using this library: 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())")
    }

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

After I select the contacts I want to be able to show them on the table view like this: TableView

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

If there is no answer or if You guys think I don't deserve the help due to my lack of experience, please send me the aid through tutorials of some sort or any relatable information of some sort. Thank y'all for the time and effort. <3

推荐答案

要从电话中获取联系方式,可以使用苹果库ABAddressBookRef

To get the contact details from phone you can use the apple library, ABAddressBookRef

请检查Apple文档

这篇关于在tableView上显示数据:将联系人从选择器调用到tableView 29并进行计数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆