title: iOS Core Bluetooth Pin Code
body: <p>I have a BLE peripheral that requires a PIN code.
  I am connecting to this peripheral using Core Bluetooth CBCentralManager on iOS 7.</p>
  
  <p>When I connect to this peripheral, 'didConnectPeripheral' (central delegate) gets called <strong>before</strong> the PIN code authentication is successfully completed.</p>
  
  <p>iOS only displays the pin code dialog <strong>after</strong> 'didConnectPeripheral' is called.</p>
  
  <p>I need to start interacting with the peripheral as soon as this PIN code dialog is finished and authentication process is complete. How can I determine when this has happened? </p>
  
  <p>The challenge is to only proceed <strong>after</strong> the authentication is successful, but:</p>
  
  <ol>
  <li>iOS calls 'didFailToConnectPeripheral' <strong>prior</strong> to the dialog
  showing.</li>
  <li>iOS does not call 'didConnectPeripheral' again if the PIN code authorisation succeeded.</li>
  <li>iOS does not call 'didFailToConnectPeripheral' again if the PIN code
  authorisation failed.</li>
  </ol>
  
  <p>From the above, I have been unable to determine:</p>
  
  <ol>
  <li>When the dialog completes.</li>
  <li>Whether the PIN code authorisation was successful.</li>
  </ol>
  
  <p>Any help would be appreciated.</p>