Register Factory Defaults for the Preferences

When your application is first launched, your PreferenceManager object will need to register the factory defaults. Add a method which registers the defaults in PreferenceManager.swift:

c​l​a​s​s​ ​P​r​e​f​e​r​e​n​c​e​M​a​n​a​g​e​r​ ​{​

 ​ ​ ​ ​p​r​i​v​a​t​e​ ​l​e​t​ ​u​s​e​r​D​e​f​a​u​l​t​s​ ​=​ ​N​S​U​s​e​r​D​e​f​a​u​l​t​s​.​s​t​a​n​d​a​r​d​U​s​e​r​D​e​f​a​u​l​t​s​(​)​

 ​ ​ ​ ​f​u​n​c​ ​r​e​g​i​s​t​e​r​D​e​f​a​u​l​t​P​r​e​f​e​r​e​n​c​e​s​(​)​ ​{​
 ​ ​ ​ ​ ​ ​ ​ ​l​e​t​ ​d​e​f​a​u​l​t​s​ ​=​
 ​ ​ ​ ​ ​ ​ ​ ​[​ ​a​c​t​i​v​e​V​o​i​c​e​K​e​y​ ​:​ ​N​S​S​p​e​e​c​h​S​y​n​t​h​e​s​i​z​e​r​.​d​e​f​a​u​l​t​V​o​i​c​e​(​)​ ​,​
 ​ ​ ​ ​ ​ ​ ​ ​ ​ ​a​c​t​i​v​e​T​e​x​t​K​e​y​ ​ ​:​ ​"​A​b​l​e​ ​w​a​s​ ​I​ ...

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.