Apple カレンダー アプリで、イベントに人を招待すると、ヘッダーの下に特定のテキストが表示されます。
私のアプリでは、ピープルピッカーも使用しています。すべての連絡先ヘッダーにユーザーのカスタム ヒントを追加したいと考えています。
ボタンの IBAction:
- (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];
}
すべてのデリゲート メソッド:
#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;
}