Apple provided a sample project called PeoplePicker that launches an ABPeoplePickerNavigationController
of only contacts that have email addresses:
ABPeoplePickerNavigationController *picker = [[ABPeoplePickerNavigationController alloc] init];
picker.peoplePickerDelegate = self;
// The people picker will only display the person's name, image and email properties in ABPersonViewController.
picker.displayedProperties = @[@(kABPersonEmailProperty)];
// The people picker will enable selection of persons that have at least one email address.
picker.predicateForEnablingPerson = [NSPredicate predicateWithFormat:@"emailAddresses.@count > 0"];
How do I display only the contacts that have mobile/telephone numbers? I already dug around the Apple docs to find what key to use for the @count
operation (emailAddresses
in this example), but I can't find it.