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.
-
The number of seconds to wait before the toolbar auto-hides.
Declaration
Swift
@MainActor private static let _autoHidePeriodInSeconds: TimeInterval -
The period of the auto-hide duration.
Declaration
Swift
@MainActor private static let _autoHideAnimationDurationInSeconds: TimeInterval -
The repeat rate of the alarm “pulses.”
Declaration
Swift
@MainActor private static let _alarmDurationInSeconds: TimeInterval -
The number of milliseconds to allow for timer leeway.
Declaration
Swift
@MainActor private static let _leewayInMilliseconds: Int -
The animation duration of the screen flashes.
Declaration
Swift
@MainActor private static let _flashDurationInSeconds: TimeInterval -
Used to instantiate (if necessary).
Declaration
Swift
@MainActor static let storyboardID: String -
Used to fetch in a segue.
Declaration
Swift
@MainActor static let segueID: String -
This will provide haptic/audio feedback for subtle events.
Declaration
Swift
@MainActor private let _selectionFeedbackGenerator: UISelectionFeedbackGenerator -
This will provide haptic/audio feedback for more significant events.
Declaration
Swift
@MainActor private let _impactFeedbackGenerator: UIImpactFeedbackGenerator -
The timer for automatically hiding the toolbar.
Declaration
Swift
@MainActor private var _autoHideTimer: RVS_BasicGCDTimer? -
The timer that is set when the alarm is sounding.
Declaration
Swift
@MainActor private var _alarmTimer: RVS_BasicGCDTimer? -
This is the audio player (for playing alarm sounds).
Declaration
Swift
@MainActor private var _audioPlayer: AVAudioPlayer! -
If the slider is up, it will be stored here.
Declaration
Swift
@MainActor private weak var _timeSetSlider: UISlider? -
If this is true, then the next transition will suppress its flash (used for switching timers).
Declaration
Swift
@MainActor private var _suppressFlash: Bool -
The running timer.
Declaration
Swift
@MainActor weak var timer: Timer? -
This is set to true, if we want to override the pref.
Declaration
Swift
@MainActor var forceStart: Bool -
This is our numerical display instance.
Declaration
Swift
@MainActor weak var numericalDisplayController: RiValT_RunningTimer_Numerical_ViewController? -
This is our circular display instance.
Declaration
Swift
@MainActor weak var circularDisplayController: RiValT_RunningTimer_Circular_ViewController? -
This is our stoplights display instance.
Declaration
Swift
@MainActor weak var stoplightDisplayController: RiValT_RunningTimer_Stoplights_ViewController? -
This references the main app delegate.
It’s an implicit optional, because the whole shebang goes into the crapper, if it doesn’t work.
Declaration
Swift
@MainActor weak var appDelegateInstance: RiValT_AppDelegate! { get } -
This references the iOS app instance of the Watch Delegate class.
It’s an implicit optional, because the whole shebang goes into the crapper, if it doesn’t work.
Declaration
Swift
@MainActor weak var watchDelegate: RiValT_WatchDelegate! { get } -
The view across the back that is filled with a color, during a “flash.”
Declaration
Swift
@IBOutlet @MainActor weak var flasherView: UIView? -
This contains the running timer for numerical format.
Declaration
Swift
@IBOutlet @MainActor weak var numericalTimerContainerView: UIView? -
This contains the running timer for circular format.
Declaration
Swift
@IBOutlet @MainActor weak var circularContainerView: UIView? -
This contains the running timer for stoplight format.
Declaration
Swift
@IBOutlet @MainActor weak var stoplightTimerContainerView: UIView? -
This is the toolbar that may (or may not) be displayed at the bottom of the screen.
Declaration
Swift
@IBOutlet @MainActor weak var controlToolbar: UIToolbar? -
The “Play” or “Pause” toolbar button.
Declaration
Swift
@IBOutlet @MainActor weak var playPauseToolbarItem: UIBarButtonItem? -
The “Stop” toolbar button.
Declaration
Swift
@IBOutlet @MainActor weak var stopToolbarItem: UIBarButtonItem? -
The “Fast Forward” toolbar button.
Declaration
Swift
@IBOutlet @MainActor weak var fastForwardToolbarItem: UIBarButtonItem? -
The “Rewind” toolbar button.
Declaration
Swift
@IBOutlet @MainActor weak var rewindToolbarItem: UIBarButtonItem? -
The single-tap gesture recognizer.
Declaration
Swift
@IBOutlet @MainActor var singleTapGestureRecognizer: UITapGestureRecognizer? -
The double-tap gesture recognizer.
Declaration
Swift
@IBOutlet @MainActor var doubleTapGestureRecognizer: UITapGestureRecognizer? -
The left-swipe gesture recognizer.
Declaration
Swift
@IBOutlet @MainActor var leftSwipeGestureRecognizer: UISwipeGestureRecognizer? -
The right-swipe gesture recognizer.
Declaration
Swift
@IBOutlet @MainActor var rightSwipeGestureRecognizer: UISwipeGestureRecognizer? -
The long-press gesture recognizer, for setting the value directly.
Declaration
Swift
@IBOutlet @MainActor var dragValueLongPressGestureRecognizer: UILongPressGestureRecognizer? -
The view to which the recognizer is attached.
Declaration
Swift
@IBOutlet @MainActor weak var longPressDetectionView: UIView? -
The view that is used to contain the slider to set the time. This is not available in Toolbar Displayed Mode.
Declaration
Swift
@IBOutlet @MainActor weak var timeSetSwipeContainerView: UIView? -
This label displays the time in the slider.
Declaration
Swift
@IBOutlet @MainActor weak var timeSetDisplayLabel: UILabel? -
This shows over the screen, when paused.
Declaration
Swift
@IBOutlet @MainActor weak var pausedLabel: UILabel?
-
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 }
-
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
inIsAnimatedTrue, if animated.
-
Called before the screen is hidden.
Declaration
Swift
@MainActor override func viewWillDisappear(_ inIsAnimated: Bool)Parameters
inIsAnimatedTrue, 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
inKeyPressesThe pressed keys.
inEventThe 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
inSegueThe segue instance.
senderIgnored.
-
Triggers a selection haptic.
Declaration
Swift
@MainActor func selectionHaptic() -
Triggers an impact haptic.
Declaration
Swift
@MainActor func impactHaptic(_ inIntensity: CGFloat = 0.5)Parameters
inIntensity0.0 -> 1.0, with 0 being the least, and 1 being the most. Optional (default is 0.5)
-
This shows the current display, and hides the others.
Declaration
Swift
@MainActor func exposeCurrentDisplay() -
This animates the toolbar into visibility.
Declaration
Swift
@MainActor func showToolbar() -
This animates the toolbar into invisibility.
Declaration
Swift
@MainActor func hideToolbar() -
This resets the timer to the start.
Declaration
Swift
@MainActor func rewindHit() -
This stops the timer, and dismisses the screen.
Declaration
Swift
@MainActor func stopHit() -
This either pauses a running timer, resumes a paused timer, or starts a stopped timer.
Declaration
Swift
@MainActor func playPauseHit() -
This pushes the timer to the end (alarm state).
Declaration
Swift
@MainActor func fastForwardHit() -
This flashes the screen briefly cyan (pause)
Declaration
Swift
@MainActor func flashCyan() -
This flashes the screen briefly green
Declaration
Swift
@MainActor func flashGreen() -
This flashes the screen briefly yellow
Declaration
Swift
@MainActor func flashYellow() -
This flashes the screen briefly red
Declaration
Swift
@MainActor func flashRed(_ inIsHard: Bool = false) -
This flashes the given timer number, in an expanding and fading image.
Declaration
Swift
@MainActor func flashTimerNumber(_ inNumber: Int) -
This enables (or disables) toolbar items, as necessary for the current state.
Declaration
Swift
@MainActor func setToolbarEnablements() -
Updates all the embeds.
Declaration
Swift
@MainActor func updateDisplays() -
Called when this timer reaches the end.
Declaration
Swift
@MainActor func alarmReached() -
Called when this timer transitions to the next timer.
Declaration
Swift
@MainActor func triggerTransitionAlarm() -
Called when all timers in the group are done.
Declaration
Swift
@MainActor func triggerFinalAlarm() -
This just plays an alarm sound, vibrates the phone, or does nothing.
Declaration
Swift
@MainActor func playAlarmSound() -
This just plays the transition sound.
Declaration
Swift
@MainActor func playTransitionSound() -
This plays any sound, using a given URL.
Declaration
Swift
@MainActor func playThisSound(_ inSoundURL: URL, numberOfRepeats inRepeatCount: Int = -1)Parameters
inSoundURLThis is the URI to the sound resource.
inRepeatCountThe number of times to repeat. -1 (continuous), if not provided.
-
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) -
The long-press on the bottom of the screen was detected.
See moreDeclaration
Swift
@IBAction @MainActor func longPressGestureDetected(_ inGestureRecognizer: UILongPressGestureRecognizer)Parameters
inGestureRecognizerThe gesture recognizer that was triggered.
-
One of the toolbar controls was hit.
Declaration
Swift
@IBAction @MainActor func toolbarItemHit(_ inSender: UIBarButtonItem)Parameters
inSenderThe 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
inTimerThe timer instance.
inFromModeThe state the timer is moving from (ignored).
inToModeThe new timer state.
-
Called when the timer fires.
Declaration
Swift
@MainActor func basicGCDTimerCallback(_ inTimer: RVS_BasicGCDTimer)Parameters
inTimerThe timer
View on GitHub