April 2015
Intermediate to advanced
556 pages
17h 47m
English
In Chapter 6 and Chapter 7, you built SpeakLine. Revisit the app and make it give visual feedback to the user. As the speech synthesizer speaks, colorize the word that is being spoken.
You will need to implement the following method from NSSpeechSynthesizerDelegate:
optional func speechSynthesizer(sender: NSSpeechSynthesizer,
willSpeakWord characterRange: NSRange,
ofString string: String!)
The first argument, as it always is, is the object being helped – in this case, the speech synthesizer. The third argument is the string the speech synthesizer is speaking. The second argument is the one you will need to use. It is an NSRange which describes which characters in the string are currently ...
Read now
Unlock full access