title: Detect if "delete" button on iOS keyboard is pressed in empty UISearchBar
body: <p>I am wondering if there is a way to detect when user press <kbd>delete</kbd> button or try to erase character in <code>UISearchBar</code>? I searched for quite a bit on Google and I tried couple of solutions where one put a <code>whiteSpaceCharacter</code> in the empty <code>UITextField</code> and the other use <code>shouldChangeTextInRange</code> delegate to do.</p>
  
  <p>The one with empty space, the user can somehow know that there is a space there by just press hold and highlight the space so I think that was not a very good solution.</p>
  
  <p>The one that use <code>shouldChangeTextInRange</code> does not work when the search bar is empty.</p>
  
  <p>Another thing to note is that majority of the solutions I found was in Objective C and it would be great if there are some way I can do this in Swift. Or would be great if anyone can point me to the right path.</p>