I have project that is using the new Contacts
framework introduced in iOS 9
Several of my UITableView
subclasses call up a CNContactPicker
and I wanted to make use of the search bar that appears at the top.
A couple of these views just implement the delegate method - contactPicker:didSelectContact:
and another implements both that method and also - contactPicker:didSelectContacts:
, the implementation of which causes the CNContactPicker
to allow multiple selections.
I made the various classes declare they were UISearchControllerDelegates
and was delight to see that that was all that was required to make the selection work with my contactPicker delegate methods.
Unfortunately the third view didn't work - you type into the search field and it provides a filter list based on what you typed but when you tap to select, the selection is highlighted but nothing more happens. If I go back to the code and comment out the contactPicker:didSelectContacts
: method then it works,
Presumably there is a way to make this respond as otherwise the CNContactPicker
view wouldn't be displaying the search bar when multiple selections were allowed.
What should I be doing to make this work ?