LGV_Timer_State

class LGV_Timer_State : NSObject, NSCoding, Sequence

This class encapsulates the entire app status.

  • Declaration

    Swift

    var timerSelected: Bool { get }

    Return Value

    True, if a timer is currently selected.

  • Declaration

    Swift

    var showControlsInRunningTimer: Bool { get set }

    Return Value

    True, if the control bar is shown in the running timer.

  • Setting this will cause the app to select a new timer.

    Declaration

    Swift

    var selectedTimer: TimerSettingTuple! { get set }

    Return Value

    The current running timer. Nil, if no timer selected (list of timers).

  • Setting this will cause the app to select a new timer.

    Declaration

    Swift

    var selectedTimerIndex: Int { get set }

    Return Value

    The 0-based index of the currently selected timer. -1 if the timer list is displayed.

  • Declaration

    Swift

    var selectedTimerUID: String { get set }

    Return Value

    The UUID of the currently selected timer (or an empty string)

  • Declaration

    Swift

    var nextTimer: Int { get }

    Return Value

    The 0-based index of the next timer (-1 if none).

  • Declaration

    Swift

    var isEmpty: Bool { get }

    Return Value

    True, if there are no timers in the list.

  • Declaration

    Swift

    var count: Int { get }

    Return Value

    The number of timers in the lisy.

  • Declaration

    Swift

    var timers: [TimerSettingTuple] { get set }

    Return Value

    The list of timers (accessor)

  • Declaration

    Swift

    var dictionary: [String : Any] { get set }

    Return Value

    The timer list, as a dictionary, with selectedTimerIndex as an element indicating which of the timers is selected, and an Array of timers.

  • Simple direct initializer with a delegate

    Declaration

    Swift

    init(delegate: LGV_Timer_StateDelegate)

    Parameters

    delegate

    The delegate for this object.

  • Initialize from a stored dictionary.

    Declaration

    Swift

    init(dictionary: [String : Any], delegate: LGV_Timer_StateDelegate! = nil)

    Parameters

    dictionary

    This is a Dictionary that contains the state.

    delegate

    This is the owner of this instance. Default is nil.

  • Declaration

    Swift

    subscript(index: Int) -> TimerSettingTuple { get }

    Parameters

    index

    The 0-based index of the requested element.

    Return Value

    The tuple at the given subscript.

  • Get the index of an element by its UUID

    Declaration

    Swift

    func indexOf(_ inUID: String) -> Int

    Parameters

    inUID

    The UUID of the element we’re looking for.

    Return Value

    The 0-based index of the given element.

  • Get the index of an element

    Declaration

    Swift

    func indexOf(_ inObject: TimerSettingTuple) -> Int

    Parameters

    inObject

    The element we’re looking for.

    Return Value

    The 0-based index of the given element.

  • See if our settings contain an object.

    Declaration

    Swift

    func contains(_ inObject: TimerSettingTuple) -> Bool

    Parameters

    inObject

    The element we’re looking for.

    Return Value

    true, if the settings array contains the given object.

  • See if our settings contain an object by its UUID.

    Declaration

    Swift

    func contains(_ inUID: String) -> Bool

    Parameters

    inUID

    The UUID of the element we’re looking for.

    Return Value

    true, if the settings array contains the given object.

  • Declaration

    Swift

    func makeIterator() -> AnyIterator<TimerSettingTuple>

    Return Value

    A new, initialized iterator of the settings.

  • Append a new object to the end of our array.

    Declaration

    Swift

    func append(_ inObject: TimerSettingTuple)

    Parameters

    inObject

    The object we’re appending.

  • Remove an object at the given 0-based index.

    Declaration

    Swift

    func remove(at index: Int)

    Parameters

    at

    The 0-based index of the object to be removed.

  • Initialize from a serialized state.

    Declaration

    Swift

    required init?(coder: NSCoder)

    Parameters

    coder

    The coder we’ll be getting the state from.

  • Serialize the object state.

    Declaration

    Swift

    func encode(with: NSCoder)

    Parameters

    with

    The coder we’ll be setting the state into.