5

Im using a CNContactPickerViewController and I want to hide the cancel and the group buttons I tried contactPickerViewController.navigationItem.leftBarButtonItem = nil and

contactPickerViewController.navigationItem.hidesBackButton = true

but that doesnt work.. Here my code to create the controller

let contactPickerViewController = CNContactPickerViewController()

    contactPickerViewController.predicateForEnablingContact = NSPredicate(format: "phoneNumbers.@count > 0",
        argumentArray: nil)

    contactPickerViewController.delegate = self
    contactPickerViewController.navigationItem.leftBarButtonItem = nil
    contactPickerViewController.navigationItem.hidesBackButton = true

    presentViewController(contactPickerViewController, animated: true, completion: nil)

Help anyone? Thanks

Alex Zavatone
  • 4,106
  • 36
  • 54
jerem
  • 1,016
  • 2
  • 12
  • 27
  • Why would you want to remove the cancel button? Users hate being trapped in non-dismissable dialogs. Why would you want to hide the Group button? If the user has made groups so they can find their contacts easily, why would you want to take that away from them? – Curmudgeonlybumbly May 03 '16 at 17:13
  • I do need the cancel button but I want it as the left bar button and three buttons make the UI overload but thanks for answering – jerem May 03 '16 at 18:28
  • Did you find any solution ? – ManiaChamp Dec 01 '16 at 19:33
  • @ManiaChamp no , I write my own contactPickerView , the new Contact framework made it very simple ... Good luck – jerem Dec 03 '16 at 22:19
  • @jerem will u share your code for reference. I am also stuck at same. I want to show only cancel button – bittu Sep 05 '18 at 12:40

0 Answers0