Challenge: Color Text as SpeakLine Speaks It

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:

o​p​t​i​o​n​a​l​ ​f​u​n​c​ ​s​p​e​e​c​h​S​y​n​t​h​e​s​i​z​e​r​(​s​e​n​d​e​r​:​ ​N​S​S​p​e​e​c​h​S​y​n​t​h​e​s​i​z​e​r​,​
 ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​w​i​l​l​S​p​e​a​k​W​o​r​d​ ​c​h​a​r​a​c​t​e​r​R​a​n​g​e​:​ ​N​S​R​a​n​g​e​,​
 ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​o​f​S​t​r​i​n​g​ ​s​t​r​i​n​g​:​ ​S​t​r​i​n​g​!​)​

The first argument, as it always is, is the object ...

Get Cocoa Programming for OS X: The Big Nerd Ranch Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.