title: Restrict user to only entering one word in UITextField
body: <p>Is there a way to only allow the user enter one word in the <code>UITextField</code>? If so, how?</p>
  
  <p>Here's the current code that I'm using:</p>
  
  <pre><code>-(BOOL) textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string{
  
  _disallowedCharacters = [NSCharacterSet whitespaceCharacterSet];
  
  for(int i = 0; i &lt; [_searchBox.text length]; i++){
      unichar c = [_searchBox.text characterAtIndex:i];
      if (![_disallowedCharacters characterIsMember:c])
      {
          return NO;
      }
  }
  return YES;
  }
  </code></pre>