ios - How to fetch Birthday Label from CNContactPickerViewController in objective-c? -
i know in swift how pick birthday label cncontactpickerviewcontroller, little bit confuse in objective-c
here use code like:in objective-c
how can pick birthday label in "didselectcontactproperty" method. can please me out..
-(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"); }
Comments
Post a Comment