TheBestClockPrefs
@objc(TheBestClockPrefs)
class TheBestClockPrefs : NSObject
-
Declaration
Swift
class func registerDefaults()
-
This is the key for the prefs used by this app.
Declaration
Swift
private static let _mainPrefsKey: String
-
The fixed number of alarms
Declaration
Swift
private static let _numberOfAlarms: Int
-
We load the user prefs into this Dictionary object.
Declaration
Swift
private var _loadedPrefs: NSMutableDictionary!
-
The alarms that we have loaded
Declaration
Swift
private var _alarms: [TheBestClockAlarmSetting]
-
These are the keys we use for our persistent prefs dictionary.
See moreDeclaration
Swift
private enum PrefsKeys : String
-
This method loads the main prefs into our instance storage.
NOTE: This will overwrite any unsaved changes to the current _loadedPrefs property.
Declaration
Swift
func loadPrefs() -> Bool
Return Value
a Bool. True, if the load was successful.
-
This is our minimum brightness threshold. We don’t let the text and stuff quite make it to 0.
Declaration
Swift
static let minimumBrightness: CGFloat
-
This tells us whether or not the device is set for military time.
Declaration
Swift
static var using12hClockFormat: Bool { get }
-
This tells us whether or not the device is set for kilometers.
Declaration
Swift
static var usingKilometeres: Bool { get }
-
Returns the 0-based index of the first weekday for the current calendar (0 = Sunday, 6 = Saturday).
Declaration
Swift
static var indexOfWeekStart: Int { get }
-
Gets a localized version of the weekday name from an index.
Cribbed from Here: http://stackoverflow.com/questions/7330420/how-do-i-get-the-name-of-a-day-of-the-week-in-the-users-locale#answer-34289913
Declaration
Swift
class func weekdayNameFromWeekdayNumber(_ weekdayNumber: Int, short: Bool = false) -> String
Return Value
The localized, full-length weekday name (or shortened, if short is true).
-
Declaration
Swift
var alarms: [TheBestClockAlarmSetting] { get set }
Return Value
An Array of alarm settings objects.
-
Declaration
Swift
var snoozeCount: Int { get set }
Return Value
the number of snoozes to allow. Ignored, if noSnoozeLimit is true.
-
Declaration
Swift
var noSnoozeLimit: Bool { get }
Return Value
true, if we are in “Forever Snooze” mode (no limit). READ ONLY
-
Declaration
Swift
var selectedColor: Int { get set }
Return Value
the selected color index, as an Int.
-
Declaration
Swift
var selectedFont: Int { get set }
Return Value
the selected font index, as an Int.
-
Declaration
Swift
var brightnessLevel: CGFloat { get set }
Return Value
the brightness level, as a CGFloat.
-
This method simply saves the main preferences Dictionary into the standard user defaults.
Declaration
Swift
func savePrefs()