Skip to content

Instantly share code, notes, and snippets.

@Otbivnoe
Created March 16, 2018 06:33
Show Gist options
  • Save Otbivnoe/36947787d2185e5e1c05e4ddb8f46b62 to your computer and use it in GitHub Desktop.
Save Otbivnoe/36947787d2185e5e1c05e4ddb8f46b62 to your computer and use it in GitHub Desktop.
class SettingsService {
var isNotificationsEnabled: Bool {
get {
let isEnabled = UserDefaults.standard.value(forKey: #function) as? Bool
return isEnabled ?? true
}
set {
UserDefaults.standard.setValue(newValue, forKey: #function)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment