0
//import contacts by using contact picker
        CNContactPickerViewController *contactPicker = [CNContactPickerViewController new];
        contactPicker.delegate = self;



        NSPredicate *filterPredicate = [NSPredicate predicateWithFormat:@"phoneNumbers.@count >= 1"];

        contactPicker.predicateForEnablingContact = filterPredicate;


        [self presentViewController:contactPicker animated:YES completion:nil];

- (void) contactPicker:(CNContactPickerViewController *)picker
     didSelectContacts:(NSArray<CNContact *> *)contacts {
    //code for selecting multiple contacts

}


-(void)contactPickerDidCancel:(CNContactPickerViewController *)picker {
    NSLog(@"Cancell");
}

在此处输入图像描述

我正在使用上面的代码导入联系人,我可以导入联系人。但我需要从 CNContactPickerViewController 中删除搜索栏。我已经尝试过堆栈溢出中提供的以下解决方案,但它不起作用。任何帮助将不胜感激。

如何隐藏/删除联系人选取器上的搜索栏

4

1 回答 1

0

由于CNContactPickerViewController是一个UIRemoteView,你无权访问它。因此这是不可能的。

于 2019-02-28T17:47:32.443 回答