I'm trying to capture the given name of a contact when the user selects that contact from the Contact Picker. Right now I'm using this method
func contactPicker(_: CNContactPickerViewController, didSelect: CNContact){
print("Selected Contact")
}
It works but I don't see how I can get a reference to the contact object that was selected. I was trying to reference these properties CNContact
The second parameter is the selected
CNContact
object. Note thecontact
next to thedidSelect
which is missing in your example. In your example you have to usedidSelect
parameter which is yourCNContact
but contact would be a much more expressive name.