title: Why does shouldChangeTextInRange get called multiple times using predictive input?
body: <p>The predictive-input of iOS8 calls the following delegate method of <code>UITextView</code> multiple times resulting in the selected word being inserted multiple times into the view.</p>
  
  <p>This code works for typing single letters and copy/paste but not when using the predictive-input bar; why not?</p>
  
  <pre><code>- (BOOL) textView:(UITextView*)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString*)text
  {
      textView.text = [textView.text stringByReplacingCharactersInRange:range withString:text];
      return false;
  }
  </code></pre>
  
  <p>With this code; if I enter an empty UITextView and tap on "The" in the predictive text (autocomplete) view it inserts "The The" into the view by way of making three calls on this method. The parameters passed in for each call are:</p>
  
  <ul>
  <li>range : <code>{0,0}</code> text : <code>@"The"</code></li>
  <li>range : <code>{0,0}</code> text : <code>@"The"</code></li>
  <li>range : <code>{3,0}</code> text : <code>@" "</code></li>
  </ul>
  
  <p>The space I can understand; but why insert "The" twice?</p>