I open the CNContactPickerViewController for use in the application, but I want to change the way it is presented in accordance with the needs of my applications, preferably without rolling back on my own and without having to re-invent the wheel a lot. This is how I open it with Objective-C ....
self.contactPicker = [[CNContactPickerViewController alloc] init]; self.contactPicker.delegate = self; //Only enable contacts to be selected that have atleast one email address NSArray *propertyKeys = @[CNContactGivenNameKey, CNContactFamilyNameKey, CNContactEmailAddressesKey]; NSPredicate *enablePredicate = [NSPredicate predicateWithFormat:@" emailAddresses.@count != 0"]; self.contactPicker.displayedPropertyKeys = propertyKeys; self.contactPicker.predicateForEnablingContact = enablePredicate; [self presentViewController:self.contactPicker animated:YES completion:nil];
When it opens, it currently looks like this:

However, due to an error in the SDK, searching for people in this form does not work, because you cannot select from the search results. I am going to make a mistake for this, but at the same time I want to hide the search bar first. I found some old questions about removing SearchBar, but they are related to ABPeoplePickerNavigationController and are not related to CNContacts. I also do not want to use groups, and if I could remove this button and move the Cancel button to the left, that would be great and would make the selection interface in my application cleaner. Here's what I would like to look like:

Can someone tell me if this is possible and maybe point me in the right direction? I have a delegate method for getting an array of contacts after selection, my problem is how it looks in the application.
Thanks in advance!
Plasma
objective-c xcode uiviewcontroller
Plasma
source share