In Apple Calendar app, if you inviting people to event you will see specific text under header:
In my app I'm using people picker too. I would like to add a custom hint for a user over All Contacts header.
IBAction for a button:
- (IBAction)showPicker:(UIBarButtonItem *)sender {
self.addressBookController = [[ABPeoplePickerNavigationController alloc] init];
[self.addressBookController setPeoplePickerDelegate:self];
self.addressBookController.displayedProperties = [NSArray arrayWithObjects:
[NSNumber numberWithInt:kABPersonPhoneProperty],
nil];
[self presentViewController:self.addressBookController animated:YES completion:nil];
}
All delegate methods:
#pragma mark Address Book Delegate
-(void)peoplePickerNavigationControllerDidCancel:(ABPeoplePickerNavigationController *)peoplePicker{
[self.addressBookController dismissViewControllerAnimated:YES completion:nil];
}
-(BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker shouldContinueAfterSelectingPerson:(ABRecordRef)person{
return YES;
}
- (BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker shouldContinueAfterSelectingPerson:(ABRecordRef)person property:(ABPropertyID)property identifier:(ABMultiValueIdentifier)identifier {
ABMultiValueRef phonesRef = ABRecordCopyValue(person, property);
CFStringRef currentPhoneValue = ABMultiValueCopyValueAtIndex(phonesRef, identifier);
// Some custom code working with a phone number
return NO;
}