title: How to reliably detect if an external keyboard is connected on iOS 9?
body: <p>Previous to iOS 9, the most reliable method of determining whether an external keyboard is connected was to listen for <code>UIKeyboardWillShowNotification</code> and make a text field the first responder, as discussed in <a href="https://stackoverflow.com/questions/2893267/how-can-i-detect-if-an-external-keyboard-is-present-on-an-ipad">this question</a>. The notification would fire when using the virtual keyboard, but would not fire when using an external keyboard.</p>
  
  <p>However this behavior has now changed with iOS 9. <code>UIKeyboardWillShowNotification</code> also fires when an external keyboard is connected, since the new keyboard toolbar is now shown.</p>
  
  <p>It is still possible to detect the keyboard height and make a judgement whether it is the smaller toolbar or the larger virtual keyboard that is being shown. However this method is not reliable since the keyboard height has changed between the various beta and can't be counted on to stay the same over time. </p>
  
  <p>Is there a more reliable method that can be used with iOS 9?</p>