9

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 ?

SimonTheDiver
  • 1,158
  • 1
  • 11
  • 24
  • since noticed that having both didSelectContact and didSelectContacts implemented throws a warning in the log so removed the didSelectContact from the view that needs multiple select. however this doesn't affect the search bar question – SimonTheDiver Oct 19 '15 at 08:14
  • was looking at this today... in Xcode 11.6, what I see is that no search UI appears if I am allowing multi-select of contacts (`didSelectContacts`). Is this what you saw as well? – benc Aug 05 '20 at 04:46

0 Answers0