Timer_SettingsViewController

class Timer_SettingsViewController : A_TimerBaseViewController, UITableViewDelegate, UITableViewDataSource

This is the main controller class for the global settings tab screen.

  • The timer list is shown here

    Declaration

    Swift

    @IBOutlet
    weak var timerTableView: UITableView!
  • The title item for our navitem

    Declaration

    Swift

    @IBOutlet
    weak var navItemTitle: UINavigationItem!
  • The info bar button item

    Declaration

    Swift

    @IBOutlet
    weak var navInfo: UIBarButtonItem!
  • The plus button

    Declaration

    Swift

    @IBOutlet
    weak var navAdd: UIBarButtonItem!
  • The switch for showing the controls

    Declaration

    Swift

    @IBOutlet
    weak var showControlsSwitch: UISwitch!
  • The button label for that switch

    Declaration

    Swift

    @IBOutlet
    weak var showControlsButton: UIButton!
  • The ID of the info segue

    Declaration

    Swift

    private let _info_segue_id: String
  • Called when the view has finished loading.

    We use this method to establish all the localized strings, and restore the controls to reflect the stored state.

    Declaration

    Swift

    override func viewDidLoad()
  • Called when the view has changed its layout.

    Declaration

    Swift

    override func viewDidLayoutSubviews()
  • Called when the view is about to appear.

    Declaration

    Swift

    override func viewWillAppear(_ animated: Bool)
  • Called when the swictch is changed to display the timer controls in a running timer.

    Declaration

    Swift

    @IBAction
    func changedShowControlsSwitch(_ sender: UISwitch)

    Parameters

    sender

    The switch object.

  • Called when the button that acts as a label for the switch is hit. This toggles the switch.

    Declaration

    Swift

    @IBAction
    func showControlsButtonHit(_ sender: Any)

    Parameters

    sender

    The button object.

  • This is called when the Add Timer button is hit, requesting a new timer be created.

    Declaration

    Swift

    @IBAction
    func addTimerButtonHit(_ sender: Any)

    Parameters

    sender

    The button object.

  • This is called when the info button is hit, requesting that we bring in the information screen.

    Declaration

    Swift

    @IBAction
    func infoButtonHit(_ sender: Any)

    Parameters

    sender

    The button object.

  • Declaration

    Swift

    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int

    Parameters

    tableView

    The UITableView object requesting the view

    numberOfRowsInSection

    The section index (0-based).

  • This is the routine that creates a new table row for the Timer indicated by the index.

    Declaration

    Swift

    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell

    Parameters

    tableView

    The UITableView object requesting the view

    cellForRowAt

    The IndexPath of the requested cell.

  • Called before a row is selected.

    Declaration

    Swift

    func tableView(_ tableView: UITableView, willSelectRowAt indexPath: IndexPath) -> IndexPath?

    Parameters

    tableView

    The table view being checked

    willSelectRowAt

    The indexpath of the row being selected.

    Return Value

    nil (don’t let selection happen).

  • Indicate that a row can be edited (for left-swipe delete).

    Declaration

    Swift

    func tableView(_ tableView: UITableView, canEditRowAt indexPath: IndexPath) -> Bool

    Parameters

    tableView

    The table view being checked

    canEditRowAt

    The indexpath of the row to be checked.

    Return Value

    true, as long as there are more than one timers.

  • Called to do a delete action.

    Declaration

    Swift

    func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCell.EditingStyle, forRowAt indexPath: IndexPath)

    Parameters

    tableView

    The table view being checked

    commit

    The action to perform.

    forRowAt

    The indexpath of the row to be deleted.

  • Called to do a delete action.

    Declaration

    Swift

    func doADirtyDeedCheap(_ tableView: UITableView, forRowAt indexPath: IndexPath)

    Parameters

    tableView

    The table view being checked

    forRowAt

    The indexpath of the row to be deleted.

  • Called to cancel a delete action.

    Declaration

    Swift

    func dontDoADirtyDeedCheap(_ tableView: UITableView)

    Parameters

    tableView

    The table view being checked

  • This method adds all the accessibility stuff.

    Declaration

    Swift

    override func addAccessibilityStuff()