I want to create an inline address book search on my application. Basically I have a UITextField and I want it so that when you start typing te开发者_JAVA技巧xt in, it will bring up search results from your Address Book, and can auto-complete what you're typing when you click it. If you look in the SMS or Mail application, typing in the "To" field when sending a message is exactly what I want.
I've looked through Apple's Address Book Programming Guide and the closest thing it has is ABPeoplePickerNavigationController. But this brings up a new view controller, which is not what I want. So my question is, is there an iOS API that allows me to use this search functionality? Or do I have to write my own?
tl;dr How do I mimic Apple's Address Book search function directly in a text field?
This demo project includes source code to perform an inline address book search from a UISearchBar.
You'll need to use the ABAddressBookCopyPeopleWithName API.
精彩评论