Я знаю, как быстро выбрать метку дня рождения из CNContactPickerViewController, но я немного запутался в Objective-c
Здесь я использую такой код: В Objective-c
Как я могу выбрать метку дня рождения в методе didSelectContactProperty. Не могли бы вы мне помочь..
-(void)presentContacts {
CNContactPickerViewController *picker = [[CNContactPickerViewController alloc] init];
NSArray *propertyKeys = @[CNContactBirthdayKey, CNContactPhoneNumbersKey, CNContactGivenNameKey, CNContactFamilyNameKey, CNContactOrganizationNameKey];
NSPredicate *enablePredicate = [NSPredicate predicateWithFormat:@"birthday != nil"];
picker.displayedPropertyKeys = propertyKeys;
picker.predicateForEnablingContact = enablePredicate;
picker.delegate = self;
[self presentViewController:picker animated:YES completion:nil];
}
- (void)contactPickerDidCancel: (CNContactPickerViewController *) picker {
NSLog(@"didCancel");
}
- (void)contactPicker: (CNContactPickerViewController *) picker didSelectContact: (CNContact *)contact{
NSLog(@"didSelectContact");
}
- (void)contactPicker: (CNContactPickerViewController *) picker didSelectContactProperty: (CNContactProperty *)contactProperty{
NSLog(@"didSelectProperty");
}
CNContact
имеет свойствоbirthday
. - person Ben Affleck   schedule 25.04.2016