CGA_WatchOS_MainInterfaceController

class CGA_WatchOS_MainInterfaceController : CGA_WatchOS_BaseInterfaceController

This is the controller for the initial extension screen.

  • id

    This is the ID for the main Discovery Screen.

    Declaration

    Swift

    static let id: String
  • The image that indicates Bluetooth is not available.

    Declaration

    Swift

    @IBOutlet
    weak var noBTImage: WKInterfaceImage!
  • The switch that controls the scanning for Peripherals.

    Declaration

    Swift

    @IBOutlet
    weak var scanningSwitch: WKInterfaceSwitch!
  • The table that lists the discovered devices.

    Declaration

    Swift

    @IBOutlet
    weak var deviceListTable: WKInterfaceTable!
  • The “More” button.

    Declaration

    Swift

    @IBOutlet
    weak var infoButton: WKInterfaceButton!

IBAction Methods

  • Called when the Scanning switch changes value

    Declaration

    Swift

    @IBAction
    func scanningSwitchChanged(_ inIsOn: Bool)

    Parameters

    inIsOn

    True, if the switch is now on.

Instance Methods

  • Establishes accessibility labels.

    Declaration

    Swift

    func setAccessibility()

Base Class Override Methods

  • Called as the View is set up.

    Declaration

    Swift

    override func awake(withContext inContext: Any?)

    Parameters

    withContext

    The context provided to the view, as it was instantiated.

  • Table touch handler.

    Declaration

    Swift

    override func contextForSegue(withIdentifier inSegueIdentifier: String, in inTable: WKInterfaceTable, rowIndex inRowIndex: Int) -> Any?

    Parameters

    withIdentifier

    The segue ID for this (we ignore)

    in

    The table instance

    rowIndex

    The vertical position (0-based) of the row that was touched.

    Return Value

    The context, if any. Can be nil.

  • Called before the view disappears. We use this to stop the scanning.

    Declaration

    Swift

    override func willDisappear()

Instance Methods

  • This adds devices to the table for display.

    Declaration

    Swift

    func populateTable()

CGA_WatchOS_Base_Protocol Conformance

  • This sets everything up to reflect the current state of the Central Manager.

    Declaration

    Swift

    override func updateUI()