RiValT_EditTimer_ViewController
@MainActor
class RiValT_EditTimer_ViewController : RiValT_Base_ViewController
extension RiValT_EditTimer_ViewController: UIPickerViewDataSource
extension RiValT_EditTimer_ViewController: UIPickerViewDelegate
extension RiValT_EditTimer_ViewController: UIPickerViewAccessibilityDelegate
This view controller allows us to set the timer thresholds for each individual timer.
This has a segmented switch, which allows the user to pick which of the thresholds they want to edit. Until a Start Time has been set, the Warning Time and Final time choices are disabled.
Once a Start Time is selected, the Warning Time and Final Time choices become available. They cannot be set equal to, or higher than, the Start Time. The Final Threshold can also not be higher than the Warning Threshold, unless the Warning Threshold is at 00:00:00 (off).
There is also a “Play” triangle, below the time picker. This is disabled, if the Start Time is at 00:00:00, but becomes enabled, once a Start Time has been specified. Selecting this, brings in the Running Timer Screen for the current timer.
-
These correspond to the selection in the segmented switch.
See moreDeclaration
Swift
enum TimeType : Int
-
These are the indexes for the picker columns.
See moreDeclaration
Swift
enum PickerRow : Int, CaseIterable
-
The large variant of the digital display font.
Declaration
Swift
@MainActor private static let _digitalDisplayFont: UIFont?
-
The ID for segue to the settings editor.
Declaration
Swift
@MainActor private static let _editGroupSegueID: String
-
The storyboard ID for instantiating the class.
Declaration
Swift
@MainActor static let storyboardID: String
-
The timer instance associated with this screen.
It is implicit optional, because we’re in trouble, if it’s nil.
Declaration
Swift
@MainActor weak var timer: Timer! { get set }
-
This is the page view container that “owns” this screen.
Declaration
Swift
@MainActor weak var myContainer: RiValT_TimerEditor_PageViewContainer?
-
Container for the set time wheels.
Declaration
Swift
@IBOutlet @MainActor weak var setTimeContainerView: UIView?
-
This selects between set time, warn time, and final time.
Declaration
Swift
@IBOutlet @MainActor weak var timeTypeSegmentedControl: UISegmentedControl?
-
The time set picker view.
Declaration
Swift
@IBOutlet @MainActor weak var timeSetPicker: UIPickerView?
-
The Hours label, above the picker.
Declaration
Swift
@IBOutlet @MainActor weak var hoursLabel: UILabel?
-
The Minutes label, above the picker.
Declaration
Swift
@IBOutlet @MainActor weak var minutesLabel: UILabel?
-
The Seconds label, above the picker.
Declaration
Swift
@IBOutlet @MainActor weak var secondsLabel: UILabel?
-
The toolbar at the bottom.
Declaration
Swift
@IBOutlet @MainActor weak var toolbar: UIToolbar?
-
The label above the time set, indicating the selected time.
Declaration
Swift
@IBOutlet @MainActor weak var statusLabel: UILabel?
-
The “play” triangle, under the pickers.
Declaration
Swift
@IBOutlet @MainActor weak var playButton: UIButton?
-
This is the current time that we are setting.
Declaration
Swift
@MainActor var currentTimeSetState: TimeType { get }
-
The time (in seconds) currently represented by the picker.
Declaration
Swift
@MainActor var currentPickerTimeInSeconds: Int { get }
-
This is the current time that we are setting.
Declaration
Swift
@MainActor var currentTimeInSeconds: Int { get set }
-
The group for the current timer.
Declaration
Swift
@MainActor var group: TimerGroup? { get }
-
Called when the view has loaded.
Declaration
Swift
@MainActor override func viewDidLoad()
-
Called when the view is about to appear
Declaration
Swift
@MainActor override func viewWillAppear(_ inIsAnimated: Bool)
Parameters
inIsAnimated
True, if the appearance is animated.
-
Called when the view has appeared
Declaration
Swift
@MainActor override func viewDidAppear(_ inIsAnimated: Bool)
Parameters
inIsAnimated
True, if the appearance is animated.
-
Called when the view has laid itself out.
Declaration
Swift
@MainActor override func viewDidLayoutSubviews()
-
This customizes the time set type segmented control.
Declaration
Swift
@MainActor func setUpTimeTypeSegmentedControl()
-
This enables or disables the play button.
Declaration
Swift
@MainActor func setUpPlayButton()
-
This customizes the time set type segmented control.
Declaration
Swift
@MainActor func updateTimeTypeSegmentedControl()
-
Sets the picker to reflect the current time.
Declaration
Swift
@MainActor func setTime(_ inIsAnimated: Bool = false)
Parameters
inIsAnimated
True, if the set is animated.
-
Called when the time type segmented control is changed.
Declaration
Swift
@IBAction @MainActor func timeTypeSegmentedControlChanged(_ inSegmentedControl: UISegmentedControl)
Parameters
inSegmentedControl
The control that was changed
-
Called when the “play” button is hit.
Declaration
Swift
@IBAction @MainActor func playButtonHit(_: Any)
-
This always returns the number of columns.
Declaration
Swift
@MainActor func numberOfComponents(in: UIPickerView) -> Int
-
Returns the number of rows for the designated column.
Declaration
Swift
@MainActor func pickerView(_ inPickerView: UIPickerView, numberOfRowsInComponent inComponent: Int) -> Int
-
Returns the displayed row for the selected column and row.
Declaration
Swift
@MainActor func pickerView(_ inPickerView: UIPickerView, viewForRow inRow: Int, forComponent inComponent: Int, reusing inReusing: UIView?) -> UIView
Parameters
inPickerView
The picker view
inRow
The specified row.
inComponent
The selected column.
inReusing
If the view is being reused, it is set here (ignored).
-
The height of each row.
Declaration
Swift
@MainActor func pickerView(_ inPickerView: UIPickerView, rowHeightForComponent inComponent: Int) -> CGFloat
Parameters
inPickerView
The picker view (ignored)
inComponent
The selected column (ignored)
Return Value
70 (always)
-
Called when a column of the picker view has been changed.
Declaration
Swift
@MainActor func pickerView(_ inPickerView: UIPickerView, didSelectRow inRow: Int, inComponent: Int)
Parameters
inPickerView
The picker view
inRow
The specified row.
inComponent
The selected column.
-
This returns the accessibility hint for the picker component.
Declaration
Swift
@MainActor func pickerView(_ inPickerView: UIPickerView, accessibilityLabelForComponent inComponentIndex: Int) -> String?
Parameters
inPickerView
The picker instance
inComponentIndex
The 0-based component index for the label.
Return Value
An accessibility string for the component.
-
This returns the accessibility hint for the picker component.
Declaration
Swift
@MainActor func pickerView(_ inPickerView: UIPickerView, accessibilityHintForComponent inComponentIndex: Int) -> String?
Parameters
inPickerView
The picker instance
inComponentIndex
The 0-based component index for the Hint (ignored).
Return Value
An accessibility string for the component.