RiValT_RunningTimer_ContainerViewController

@MainActor
class RiValT_RunningTimer_ContainerViewController : UIViewController
extension RiValT_RunningTimer_ContainerViewController: RVS_BasicGCDTimerDelegate

This implements a “wrapper” for the running timer views.

It embeds the timer display (either numerical, circular, or stoplight), and handles the all of the user interaction (the timer embed is read-only).

This view references a timer instance, which, in turn, is also referenced by the embedded views.

Computed Properties

  • The current timer’s timeline, including its group when Combine Timers is enabled.

    Declaration

    Swift

    @MainActor
    var countdown: TimerCountdown? { get }
  • The selected second and phase stay on screen until the user releases the combined slider.

    Declaration

    Swift

    @MainActor
    private var combinedPreview: (remaining: Int, mode: TimerEngine.Mode)? { get }
  • The remaining seconds shown by the display, using the preview while the combined slider is dragged.

    Declaration

    Swift

    @MainActor
    var displayedRemaining: Int? { get }
  • The phase shown by the display, taking the combined slider preview into account.

    Declaration

    Swift

    @MainActor
    var displayedMode: TimerEngine.Mode? { get }
  • Whether the displayed countdown is running, including the simulated position during a scrub.

    Declaration

    Swift

    @MainActor
    var displayIsRunning: Bool { get }
  • A zero-duration preset has no place on the combined countdown.

    Declaration

    Swift

    @MainActor
    private var groupTimers: [Timer] { get }
  • Finds the group timer at a signed offset from the active timer if it has a nonzero duration.

    Declaration

    Swift

    @MainActor
    private func adjacentTimer(offset: Int) -> Timer?
  • If we are in a multi-timer group, this is the previous timer.

    Declaration

    Swift

    @MainActor
    var prevTimer: Timer? { get }
  • If we are in a multi-timer group, this is the next timer.

    Declaration

    Swift

    @MainActor
    var nextTimer: Timer? { get }
  • If we are in a multi-timer group, this how many timers.

    Declaration

    Swift

    @MainActor
    var count: Int { get }
  • If we are in a multi-timer group, this is the first timer.

    Declaration

    Swift

    @MainActor
    var firstTimer: Timer? { get }
  • If we are in a multi-timer group, this is the last timer.

    Declaration

    Swift

    @MainActor
    var lastTimer: Timer? { get }
  • If we are in a multi-timer group, true, if this is the last timer.

    Declaration

    Swift

    @MainActor
    var isLastTimer: Bool { get }
  • If true, we are dragging the set slider.

    Declaration

    Swift

    @MainActor
    var isDragging: Bool { get }
  • This is true, if the display should flash.

    Declaration

    Swift

    @MainActor
    var shouldFlash: Bool { get }

Base Class Overrides

  • Declaration

    Swift

    @MainActor
    override var prefersHomeIndicatorAutoHidden: Bool { get }
  • Declaration

    Swift

    @MainActor
    override var prefersStatusBarHidden: Bool { get }
  • Called, when the view hierarchy has been loaded.

    Declaration

    Swift

    @MainActor
    override func viewDidLoad()
  • Called before the screen is displayed.

    Declaration

    Swift

    @MainActor
    override func viewWillAppear(_ inIsAnimated: Bool)

    Parameters

    inIsAnimated

    True, if animated.

  • Called before the screen is hidden.

    Declaration

    Swift

    @MainActor
    override func viewWillDisappear(_ inIsAnimated: Bool)

    Parameters

    inIsAnimated

    True, if animated.

  • This allows Catalyst apps to use the keyboard to control the timer, like gestures.

    Declaration

    Swift

    @MainActor
    override func pressesBegan(_ inKeyPresses: Set<UIPress>, with inEvent: UIPressesEvent?)

    Parameters

    inKeyPresses

    The pressed keys.

    inEvent

    The event, creating the keypresses.

  • This will assign us as the “owner” of our embedded displays.

    Declaration

    Swift

    @MainActor
    override func prepare(for inSegue: UIStoryboardSegue, sender: Any?)

    Parameters

    inSegue

    The segue instance.

    sender

    Ignored.

Instance Methods

Callbacks

  • Called when the user does a right-swipe

    Declaration

    Swift

    @IBAction
    @MainActor
    func rightSwipeReceived(_: Any)
  • Called when the user does a left-swipe

    Declaration

    Swift

    @IBAction
    @MainActor
    func leftSwipeReceived(_: Any)
  • Called when the user taps on the screen twice.

    Declaration

    Swift

    @IBAction
    @MainActor
    func doubleTapReceived(_: Any)
  • Called when the user taps on the screen once.

    Declaration

    Swift

    @IBAction
    @MainActor
    func singleTapReceived(_: Any)
  • Use the same elapsed-time scale for the touch slider and the accessible adjustment.

    Declaration

    Swift

    @MainActor
    private func setCountdownPosition(_ elapsed: Int, in countdown: TimerCountdown)
  • Advances or rewinds the countdown by one tenth of the range for an accessibility adjustment.

    Declaration

    Swift

    @MainActor
    private func adjustCountdownPosition(by direction: Int)
  • The long-press on the bottom of the screen was detected.

    See more

    Declaration

    Swift

    @IBAction
    @MainActor
    func longPressGestureDetected(_ inGestureRecognizer: UILongPressGestureRecognizer)

    Parameters

    inGestureRecognizer

    The gesture recognizer that was triggered.

  • One of the toolbar controls was hit.

    Declaration

    Swift

    @IBAction
    @MainActor
    func toolbarItemHit(_ inSender: UIBarButtonItem)

    Parameters

    inSender

    The item that was activated.

  • This is called by the model, and represents one “tick” of the timer.

    Declaration

    Swift

    @MainActor
    func tickHandler(_: Timer)
  • This is called by the model, and represents a transition, from one state to another.

    Declaration

    Swift

    @MainActor
    func transitionHandler(_ inTimer: Timer, _ inFromMode: TimerEngine.Mode, _ inToMode: TimerEngine.Mode)

    Parameters

    inTimer

    The timer instance.

    inFromMode

    The state the timer is moving from (ignored).

    inToMode

    The new timer state.

RVS_BasicGCDTimerDelegate Conformance