TheBestClockPrefs

@objc(TheBestClockPrefs)
class TheBestClockPrefs : NSObject

Class Methods

Private Static Properties

  • 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

Private Variable Properties

  • 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]

Private Enums

  • These are the keys we use for our persistent prefs dictionary.

    See more

    Declaration

    Swift

    private enum PrefsKeys : String

Private Instance Methods

  • 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.

Class Static Properties

  • 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

Class Static Calculated Properties

  • 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 }

Instance Static Methods

Instance Calculated Properties

  • 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()