April 2015
Intermediate to advanced
556 pages
17h 47m
English
Now that values for the activeVoice and activeText properties can be read from the PreferenceManager, make MainWindowController read from them when its window loads and update its window’s UI accordingly:
func windowDidLoad() {
super.windowDidLoad()
updateButtons()
speechSynth.delegate = self
for voice in voices {
println(voiceNameForIdentifier(voice)!)
}
let defaultVoice = NSSpeechSynthesizer.defaultVoice()
let defaultVoice = preferenceManager.activeVoice!
if let defaultRow = find(voices, defaultVoice) {
let indices = NSIndexSet(index: defaultRow)
tableView.selectRowIndexes(indices, byExtendingSelection: false)
tableView.scrollRowToVisible(defaultRow)
}
textField.stringValue = preferenceManager.activeText! ...Read now
Unlock full access