title: How to detect that textDidChange: on UISearchBar was triggered by dictation
body: <p>I am currently facing a problem related to <code>UISearchBar</code> and dictation support. I have to trigger some filter logic when the text of the search bar changes. This logic has to be triggered either the change was done by keyboard typing or dictation.</p>
  
  <p>Now here is my problem: If I end dictation in search bar, the <code>textDidChange</code> method is triggered immediately (while speech recognition is running). After recognition is done, the method is triggered again with the correct string.</p>
  
  <p>How do I detect that the first call of the method was triggered by the start of speech recognition? Because I have to avoid execution of my logic in this case.</p>
  
  <p>I already tried to inspect the <code>searchText</code> parameter that is passed to the method. But the results are kind of suspicious.</p>
  
  <p>If I add this code to <code>searchBar:textDidChange:</code></p>
  
  <pre><code>- (void)searchBar:(UISearchBar *)searchBar textDidChange:(NSString *)searchText
  {
      NSLog(@"SearchText [%@] - SearchTextLength [%i] - SearchTextEquals [%i]", searchText, searchText.length, [searchText isEqualToString:@""]);
  }
  </code></pre>
  
  <p>The I am getting this log result:</p>
  
  <pre><code>SearchText [￼] - SearchTextLength [1] - SearchTextEquals [0]
  </code></pre>
  
  <p>I am stuck at this point. How can the <code>searchText</code> be [] (empty) but has a length of 1? Is there another way to detect that speech recognition is still running?</p>