I am trying to use the CNContactPickerViewController and keep running into issues with how to pick multiple properties from a single contact
Basic display of the picker
let contactStore = CNContactStore()
override func viewDidLoad() {
super.viewDidLoad()
self.askForContactAccess()
self.displayContacts()
}
func displayContacts(){
let contactPicker = CNContactPickerViewController()
contactPicker.delegate = self
self.present(contactPicker, animated: true, completion: nil)
}
this displays the address book after the user gives permission(the code is there but didn't show it above)
Now what I would like to do is when the user selects a contact we navigate into the contact details view(this happens currently) but when I try to use the delegate
func contactPicker(_ picker: CNContactPickerViewController, didSelectContactProperties contactProperties: [CNContactProperty])
I get presented with the contact picker view where I can select multiple contacts. I don't mind trying to extend the contact detail view so that I can select multiple properties but I don't even know how to hook into it.
I can create a completely custom table view and select the properties there but since apple created a nice contact detail view I would rather use that.
CNContactPickerViewController#displayedPropertyKeys
with the properties you want to be displayed before the picker will display the property sheet for a specific contact – Scarcely