title: iOS 5: Changing foreground color using attributed string in UITextView
body: <p>This code works well on iOS 6</p>
  
  <pre><code>NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithString:textView.text];
  
  [attributedString addAttribute:NSForegroundColorAttributeName value:[UIColor redColor] range:[textView.text rangeOfString:self.searchString options:NSCaseInsensitiveSearch range:searchRange]];
  
  [textView setAttributedText:attributedString];
  </code></pre>
  
  <p>However NSForegroundColorAttributeName is undefined in iOS 5, so I want the equivalent of the previous code that works in iOS 5.</p>