问题
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
This is my picker:
///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())")
}
After I select the contacts I want to be able to show them on the table view like this: TableView
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
回答1:
To get the contact details from phone you can use the apple library, ABAddressBookRef
Please check the apple documentation
来源:https://stackoverflow.com/questions/34981392/displaying-data-on-a-tableview-calling-contacts-from-a-picker-to-tableview-29-a