title: CNContactViewController forUnknownContact unusable, destroys interface
body: <p><strong>[Appears to be fixed in iOS 10!]</strong> So what follows applies to iOS 9 only...</p>
  
  <hr>
  
  <p>I have been experimenting with Apple's new Contacts framework, and I've found a huge bug in one of the three forms of CNContactViewController. It destroys the surrounding interface so that your app becomes useless; the user is stuck.</p>
  
  <p>To make this bug easy to see, I've posted an example project at <a href="https://github.com/mattneub/CNContactViewControllerBug" rel="noreferrer">https://github.com/mattneub/CNContactViewControllerBug</a>.</p>
  
  <p>To experiment, run the project and do the following steps:</p>
  
  <ol>
  <li><p>Tap the button (Unknown Person).</p></li>
  <li><p>Grant access if requested.</p></li>
  <li><p>You are shown the partial contact, in our navigation interface (note the Back button at the top).</p></li>
  <li><p>Tap Add to Existing Contact. The contact picker appears.</p></li>
  <li><p>Tap Cancel. It doesn't actually matter what you do from here, but tapping Cancel is simplest and is the fastest way to reach the bug.</p></li>
  <li><p>We are now back at the partial contact, but the navigation interface is gone. The user has no way to escape from this interface. <em>The app is hosed.</em></p></li>
  </ol>
  
  <p>Just to clarify, here are screenshots of the steps you need to take:</p>
  
  <p><a href="https://i.stack.imgur.com/P3NrZ.png" rel="noreferrer"><img src="https://i.stack.imgur.com/P3NrZ.png" alt="enter image description here"></a></p>
  
  <p>Tap Add to Existing Contact to see this:</p>
  
  <p><a href="https://i.stack.imgur.com/JgAWT.png" rel="noreferrer"><img src="https://i.stack.imgur.com/JgAWT.png" alt="enter image description here"></a></p>
  
  <p>Tap Cancel to see this; observe that it is the same as the first screen shot, <em>but the navigation bar is gone</em>:</p>
  
  <p><a href="https://i.stack.imgur.com/6CjX5.png" rel="noreferrer"><img src="https://i.stack.imgur.com/6CjX5.png" alt="enter image description here"></a></p>
  
  <p>I've tried many ways to work around this bug, but there seems to be no way. As far as I can tell, this window is being presented by the framework "out-of-process" and is not part of your app. You can't get rid of it.</p>
  
  <p>So what's the question? I guess it's this: can anyone show me a way to make this view controller (in this form) usable? Is there a workaround I haven't found?</p>
  
  <p><strong>EDIT</strong> This bug appeared in iOS 9.0 and is still present in iOS 9.1. In a comment, @SergeySkopus reports that switching to the deprecated Address Book framework doesn't help; the bug is in the underlying structure somewhere.</p>