TimerRuntimeViewController

class TimerRuntimeViewController : A_TimerNavBaseController
  • The height, as a multiplier, of the dual mode traffic lights section

    Declaration

    Swift

    private let _stoplightDualModeHeightFactor: CGFloat
  • The maximum width, as a multiplier, of the podium mode traffic lights section

    Declaration

    Swift

    private let _stoplightMaxWidthFactor: CGFloat
  • The volume as a multiplier, of each audible tick.

    Declaration

    Swift

    private let _tickVolume: Float
  • Tracks the last value, so we make sure we don’t blink until we’re supposed to.

    Declaration

    Swift

    private var _originalValue: Int
  • The name of the pause button image.

    Declaration

    Swift

    let pauseButtonImageName: String
  • The name of the start button image.

    Declaration

    Swift

    let startButtonImageName: String
  • The name of the unlit podium mode traffic light image.

    Declaration

    Swift

    let offStoplightImageName: String
  • The name of the green podium mode traffic light image.

    Declaration

    Swift

    let greenStoplightImageName: String
  • The name of the yellow podium mode traffic light image.

    Declaration

    Swift

    let yellowStoplightImageName: String
  • The name of the red podium mode traffic light image.

    Declaration

    Swift

    let redStoplightImageName: String
  • The container view for the podium/dual mode lights

    Declaration

    Swift

    var stoplightContainerView: UIView!
  • The red light image

    Declaration

    Swift

    var redLight: UIImageView!
  • The yellow light image

    Declaration

    Swift

    var yellowLight: UIImageView!
  • The green light image

    Declaration

    Swift

    var greenLight: UIImageView!
  • The controller that controls this

    Declaration

    Swift

    var myHandler: TimerSetController!
  • The audio player that handles songs and sounds

    Declaration

    Swift

    var audioPlayer: AVAudioPlayer!
  • The audio player that handles each tick

    Declaration

    Swift

    var tickPlayer: AVAudioPlayer!
  • The pause button in the control bar

    Declaration

    Swift

    @IBOutlet
    weak var pauseButton: UIBarButtonItem!
  • The stop button in the control bar

    Declaration

    Swift

    @IBOutlet
    weak var stopButton: UIBarButtonItem!
  • The reset button in the control bar

    Declaration

    Swift

    @IBOutlet
    weak var resetButton: UIBarButtonItem!
  • The fast-forward-to-end button in the control bar

    Declaration

    Swift

    @IBOutlet
    weak var endButton: UIBarButtonItem!
  • The navigation item for this instance

    Declaration

    Swift

    @IBOutlet
    weak var navItem: UINavigationItem!
  • The time display

    Declaration

    Swift

    @IBOutlet
    weak var timeDisplay: LED_ClockView!
  • The view that displays the flashing lights

    Declaration

    Swift

    @IBOutlet
    weak var flasherView: UIView!
  • The navigation bar item for this instance

    Declaration

    Swift

    @IBOutlet
    weak var navBarItem: UINavigationItem!
  • The navigation bar for this instance

    Declaration

    Swift

    @IBOutlet
    weak var myNavigationBar: UINavigationBar!
  • The gesture recognizer for single taps

    Declaration

    Swift

    @IBOutlet
    var tapRecognizer: UITapGestureRecognizer!
  • The gesture recognizer for left-swipes

    Declaration

    Swift

    @IBOutlet
    var resetSwipeRecognizer: UISwipeGestureRecognizer!
  • The gesture recognizer for right-swipes

    Declaration

    Swift

    @IBOutlet
    var endSwipeRecognizer: UISwipeGestureRecognizer!
  • Bring in the setup screen.

    Declaration

    Swift

    private func _setUpDisplay()
  • This plays whatever alert sound has been chosen by the user.

    Declaration

    Swift

    private func _playAlertSound()
  • This plays a tick sound.

    Declaration

    Swift

    private func _playTickSound(times inTimes: Int = 1)

    Parameters

    times

    Optional. Default is 1. This is how many times the tick will be repeated (quick succession).

  • This plays any sound, using a given URL.

    Declaration

    Swift

    func playThisSound(_ inSoundURL: URL, times inTimes: Int = 0)

    Parameters

    inSoundURL

    This is the URI to the sound resource.

    times

    Optional Int that specifies how many times the sound will play. Default is infinite loop.

  • If the audio player is going, this pauses it. Nothing happens if no audio player is going.

    Declaration

    Swift

    func pauseAudioPlayer()
  • This terminates the audio player. Nothing happens if no audio player is going.

    Declaration

    Swift

    func stopAudioPlayer()
  • This pauses a running timer, without dismissing the screen, or resetting the timer.

    It will flash the display a subdued red.

    Declaration

    Swift

    func pauseTimer()
  • This continues a paused timer.

    It will flash the display a subdued green.

    Declaration

    Swift

    func continueTimer()
  • This stops a running timer, and dismisses the screen.

    It will flash the display a bright red.

    Declaration

    Swift

    func stopTimer()
  • This forces the timer to immediately complete its time, and go into alarm mode.

    Declaration

    Swift

    func endTimer()
  • This resets the timer to its starting value, but does not dismiss the screen.

    If the timer is paused, this will flash a subdued white. If not, it will flash a subdued red.

    Declaration

    Swift

    func resetTimer()
  • This forces the timer to update to match the current timer state.

    Declaration

    Swift

    func updateTimer()
  • This is called to play a tick sound.

    Declaration

    Swift

    func tick(times inTimes: Int = 1)

    Parameters

    times

    Optional. Default is 1. This is how many times the tick will be repeated (quick succession).

  • This flashes the display, depending on the current state of the timer.

    Declaration

    Swift

    func flashDisplay(_ inUIColor: UIColor! = nil, duration: TimeInterval = 0.75)
  • This will transition the timer to a following timer, if one is set up.

    -returns: (Discardable) True, if the next timer transition happened.

    Declaration

    Swift

    @discardableResult
    func cascadeToNextTimer() -> Bool
  • Called after the view has finished loading.

    Declaration

    Swift

    override func viewDidLoad()
  • Called when the view is about to set up its layout.

    Declaration

    Swift

    override func viewWillLayoutSubviews()
  • Called just before the view appears.

    Declaration

    Swift

    override func viewWillAppear(_ animated: Bool)
  • Called just before the view disappears.

    Declaration

    Swift

    override func viewWillDisappear(_ animated: Bool)
  • This method adds all the accessibility stuff.

    Declaration

    Swift

    override func addAccessibilityStuff()
  • Called when the stop button has been hit.

    Declaration

    Swift

    @IBAction
    func stopButtonHit(_: Any! = nil)
  • Called when the end button has been hit (or the right-swipe gesture has happened).

    Declaration

    Swift

    @IBAction
    func endButtonHit(_: Any! = nil)
  • Called when the reset button has been hit (or the left-swipe gesture has happened).

    Declaration

    Swift

    @IBAction
    func resetButtonHit(_: Any! = nil)
  • Called when the pause button has been hit (or the tap gesture has happened).

    Declaration

    Swift

    @IBAction
    func pauseButtonHit(_: Any! = nil)
  • Called when the tap gesture has happened.

    Declaration

    Swift

    @IBAction
    func tapInView(_: Any! = nil)