Skip to content

Instantly share code, notes, and snippets.

@baphillips
Created October 2, 2013 04:52
Show Gist options
  • Save baphillips/6789270 to your computer and use it in GitHub Desktop.
Save baphillips/6789270 to your computer and use it in GitHub Desktop.
- (void)speechSynthesizer:(AVSpeechSynthesizer *)synthesizer willSpeakRangeOfSpeechString:(NSRange)characterRange utterance:(AVSpeechUtterance *)utterance
{
// Highlight the portion of text that will be spoken.
NSMutableAttributedString *aString = [[NSMutableAttributedString alloc] initWithString:_textLabel.text];
[aString addAttribute:NSForegroundColorAttributeName value:[UIColor redColor] range:characterRange];
_textLabel.attributedText = aString;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment