April 2015
Intermediate to advanced
556 pages
17h 47m
English
Next, you will add computed properties to your PreferenceManager class for the two preferences: activeVoice and activeText. The getter will be used to get the value for each preference. These properties will abstract away the details of how the preferences are stored. Implement these computed properties in PreferenceManager.swift:
...
var activeVoice: String? {
get {
return userDefaults.objectForKey(activeVoiceKey) as? String
}
}
var activeText: String? {
get {
return userDefaults.objectForKey(activeTextKey) as? String
}
}
}