O'Reilly logo

Cocoa Programming for OS X: The Big Nerd Ranch Guide by Aaron Hillegass, Adam Preble, Nate Chandler

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required