I want to create a custom UINavigationBar
for CNContactViewController
in order to select single or multiple contact. The default UINavigationBar
consists of Cancel,Done and Group button which makes it look quite messy. Is there a workaround to customize
the UINavigationBar
of the CNContactViewController
?
Can Anyone answer this asap?

- 733
- 2
- 9
- 25
-
What have you tried ? Did you try to change the bar items when initialising it ? – shannoga May 04 '16 at 06:48
-
Yes but doesn't work – Isha Balla May 04 '16 at 07:33
-
1Can you paste your code? – shannoga May 04 '16 at 08:23
-
@IshaBalla Did you find a solution for this one? I am facing the same problem – Somu Aug 11 '16 at 22:55
-
I'd like to know the solution to this also. – daniel May 29 '23 at 23:58
1 Answers
Your screenshot is CNContactPickerViewController
, not CNContactViewController
. But the answer is the same for both.
The Contacts view controllers each have a very specific purpose: choosing a contact, creating a contact, etc. They each have a navigation bar suited to that purpose — the contact pocket needs that Done button so the user can select a contact and return control to your app. And they're hosted out of process so that malicious apps can't dig inside to harvest contact info they're not supposed to.
Since it's out of process, you can't customize the navigation bar directly. Contacts would need to define an API for that, and it doesn't. Perhaps you should file a feature request for that? Then again, I'm not sure what the use case for removing any of those buttons is...

- 124,678
- 26
- 272
- 326
-
-
1You could build your own contact picker and design the UI any way you want. But then the user would have to grant your app permission to read all of his/her contacts so you could display them. (Since `CNContactPickerViewController` provides only one contact, explicitly through user action, your app doesn't need blanket Contacts permission to use it.) – rickster May 11 '16 at 13:49