title: How to throttle search (based on typing speed) in iOS UISearchBar?
body: <p>I have a UISearchBar part of a UISearchDisplayController that is used to display search results from both local CoreData and remote API.
  What I want to achieve is the "delaying" of the search on the remote API. Currently, for each character typed by the user, a request is sent. But if the user types particularly fast, it does not make sense to send many requests: it would help to wait until he has stopped typing. 
  Is there a way to achieve that? </p>
  
  <p>Reading the <a href="https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/UIKitUICatalog/UISearchBar.html#//apple_ref/doc/uid/TP40012857-UISearchBar" rel="noreferrer">documentation</a> suggests to wait until the users explicitly taps on search, but I don't find it ideal in my case.</p>
  
  <blockquote>
    <p>Performance issues. If search operations can be carried out very
    rapidly, it is possible to update the search results as the user is
    typing by implementing the searchBar:textDidChange: method on the
    delegate object. However, if a search operation takes more time, you
    should wait until the user taps the Search button before beginning the
    search in the searchBarSearchButtonClicked: method. Always perform
    search operations a background thread to avoid blocking the main
    thread. This keeps your app responsive to the user while the search is
    running and provides a better user experience.</p>
  </blockquote>
  
  <p>Sending many requests to the API is not a problem of local performance but only of avoiding too high request rate on the remote server.</p>
  
  <p>Thanks</p>