April 2015
Intermediate to advanced
556 pages
17h 47m
English
The second (and far simpler) part of this chapter is enabling the user to change the voice of the speech synthesizer by selecting a voice from the table. The user can make a selection by clicking the table row or by using the arrow keys to highlight a voice. User interaction with a table view is handled by the table view’s delegate. As the delegate of the table view, your object can react when the user interacts with the table view.
In MainWindowController.swift, add the NSTableViewDelegate protocol to the MainWindowController class definition.
import Cocoaclass MainWindowController: NSWindowController, NSSpeechSynthesizerDelegate,NSWindowDelegate, NSTableViewDataSource {class MainWindowController: ...