Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

With CNContactPickerViewController in iOS 9.0, how to enable/disable single or multiple selection?

Tags:

ios9

contacts

The delegate CNContactPickerDelegate have methods for single and multiple selections. But how do we specify we want single or multiple selection when we present the view controller?

I guess I miss something that perhaps also causes the problem I have described in: CNUI ERROR Selection predicates are set but the delegate does not implement contactPicker:didSelectContact:

like image 587
PatrickV Avatar asked Sep 28 '15 03:09

PatrickV


1 Answers

You need to implement ONLY the method you need.

If you want only one contact, implement:

contactPicker:didSelectContact:

If you want multiple selection, implement:

contactPicker:didSelectContacts:

If you want select one property for one contact, implemente:

contactPicker:didSelectContactProperty:

And the last one, don't know how work, looks like a bug, because if I implement it, I get the multiple contact selection UI, but can't select properties.

contactPicker:didSelectContactProperties:

EDIT: Finally I got some data from didSelectContactProperties, this method required a definition in predicateForSelectionOfProperty. I think the name is incorrect, should be didSelectContactsProperties, because I got the properties for multiple contacts.

like image 68
Joel Avatar answered Sep 18 '22 09:09

Joel