TimerSettings

struct TimerSettings

This struct contains the current settings for the timer.

  • KVP

    This has the timer settings in a Key-Value-Pair (KVP) fashion, for storage.

    Declaration

    Swift

    typealias KVP = (key: String, value: [Int])

    Parameters

    key

    The key, which is from the UUID string.

    value

    A three-element Array of Int: - 0 is start time - 1 is warn time - 2 is final time. The values are seconds.

  • The start time (as seconds)

    Declaration

    Swift

    private var _startTime: Int
  • The warning time (as seconds)

    Declaration

    Swift

    private var _warnTime: Int
  • The warning time (as seconds)

    Declaration

    Swift

    private var _finalTime: Int
  • id

    The ID, which is set from a UUID.

    Declaration

    Swift

    let id: String
  • The start time (as seconds)

    Declaration

    Swift

    var startTime: Int { get set }
  • The start time (as hours, minutes, and seconds)

    Declaration

    Swift

    var startTimeAsComponents: [Int] { get }
  • The warning time (as seconds)

    Declaration

    Swift

    var warnTime: Int { get set }
  • The warning time (as hours, minutes, and seconds)

    Declaration

    Swift

    var warnTimeAsComponents: [Int] { get }
  • The warning time (as seconds)

    Declaration

    Swift

    var finalTime: Int { get set }
  • The final time (as hours, minutes, and seconds)

    Declaration

    Swift

    var finalTimeAsComponents: [Int] { get }
  • Declaration

    Swift

    var index: Int { get }

    Return Value

    The timer’s index. -1 if not found.

  • kvp

    Declaration

    Swift

    var kvp: KVP { get }

    Return Value

    The timer, expressed as a KVP.

  • Declaration

    Swift

    var isCurrent: Bool { get set }

    Return Value

    True, if this is the currently selected timer. Setting this, selects this timer.

  • Initializer, from a KVP

    Declaration

    Swift

    init(_ inKVP: KVP)

    Parameters

    inKVP

    The KVP, specifying this timer.

  • Initializer with values. All are optional.

    Declaration

    Swift

    init(id inID: String = UUID().uuidString, startTime inStartTime: Int = 0, warnTime inWarnTime: Int = 0, finalTime inFinalTime: Int = 0)

    Parameters

    id

    The unique ID string. If not provided, a new one is created as a UUID string.

    startTime

    The start time, in seconds. If not provided, this is 0.

    warnTime

    The warning time, in seconds. If not provided, this is 0.

    finalTime

    The final time, in seconds. If not provided, this is 0.