title: Dismissing keyboard in appium test on iOS
body: <p>How do you dismiss the keyboard in an Appium test on iOS? I get this entry in the console after entering text</p>
  
  <pre><code>[INSTSERVER] Sending command to instruments: if (!au.mainApp().keyboard().isNil()) {
    var key = au.mainApp().keyboard().buttons()['Done']
    if (key.isNil()) {
      var startY = au.mainApp().keyboard().rect().origin.y - 10;
      var endY = au.mainWindow().rect().size.height - 10;
      au.flickApp(0, startY, 0, endY);
    } else {
      key.tap();
    }
    au.delay(1000);
  }
  </code></pre>
  
  <p>I can see it is assuming the button is 'Done' on my keyboard it is 'return'. Looking at the documentation I should be able to do this in the following way <a href="https://github.com/appium/ruby_lib/blob/ef20cdd09cdb3dac32b789144b17ed2daf745a8d/docs/ios_docs.md#hide_keyboard" rel="nofollow">https://github.com/appium/ruby_lib/blob/ef20cdd09cdb3dac32b789144b17ed2daf745a8d/docs/ios_docs.md#hide_keyboard</a></p>
  
  <p>I have tried this using the following code:</p>
  
  <pre><code>When(/^I enter the text "(.*?)"$/) do |user_text|
    textfield( "My Textbox" ).type user_text
    hide_keyboard( "Return" )
  end
  </code></pre>
  
  <p>Despite this it still hangs looking for the 'Done' button. How do you override which key Appium looks for. I have uploaded a Git repository with my code here: <a href="https://github.com/developerdave/AppiumText" rel="nofollow">GitHub Repository</a></p>
  
  <p>When I use 'Done' as the keyboard button to Return it works. Problem is my app doesn't use 'Done'.</p>