With iOS 8 ABPeoplePickerNavigationController has:
// Optionally determines if a person can be selected or not.
// If not set, all persons will be selectable.
//
@property(nonatomic,copy) NSPredicate *predicateForEnablingPerson NS_AVAILABLE_IOS(8_0);
I'd like to disable the address book contacts that don't have a street address.
I've seen (and tested) the following, which only enables contacts with at least one email address:
if ([peoplePickerNavigationController respondsToSelector:@selector(predicateForEnablingPerson)]) {
peoplePickerNavigationController.predicateForEnablingPerson = [NSPredicate predicateWithFormat:@"emailAddresses.@count > 0"];
}
What do I replace the string "emailAddresses.@count > 0" with in order to only enable contacts with at least one street address?
You can use:
The header gives a list of the acceptable constants to be used in predicates:
If you look at the header, that's
postalAddresses