From iOS 8, ABPeoplePickerNavigationController has a property that solves your problem:
@property (nonatomic,copy) predicateForEnablingPerson
Sample code from an Apple document: https://developer.apple.com/library/prerelease/ios/samplecode/PeoplePicker/Listings/PeoplePicker_AAPL_8or7_EmailPickerViewController_m.html )
ABPeoplePickerNavigationController* abPicker = [ABPeoplePickerNavigationController new]; abPicker.peoplePickerDelegate = self; //... if ([abPicker respondsToSelector:@selector(setPredicateForEnablingPerson:)]){ // The people picker will enable selection of persons that have at least one email address. abPicker.predicateForEnablingPerson = [NSPredicate predicateWithFormat:@" emailAddresses.@count > 0"]; }
Please note that from iOS9 ABPeoplePavlerNavigationController is deprecated, you can use the new CNContactPickerViewController in the same way with the property:
@property(nonatomic, copy) NSPredicate *predicateForEnablingContact
From the doc:
You can set a value for this property to determine which contact should be available for selection, for example, an email address. @count> 0 to make all contacts that have an email address available for selection. If no predicate is specified for this property, all contacts become available.
source share