CGA_WatchOS_MainInterfaceController
@MainActor
class CGA_WatchOS_MainInterfaceController : CGA_WatchOS_BaseInterfaceController
This is the controller for the initial extension screen.
-
This is the ID for the main Discovery Screen.
Declaration
Swift
@MainActor static let id: String -
The image that indicates Bluetooth is not available.
Declaration
Swift
@IBOutlet @MainActor weak var noBTImage: WKInterfaceImage! -
The switch that controls the scanning for Peripherals.
Declaration
Swift
@IBOutlet @MainActor weak var scanningSwitch: WKInterfaceSwitch! -
The table that lists the discovered devices.
Declaration
Swift
@IBOutlet @MainActor weak var deviceListTable: WKInterfaceTable! -
The “More” button.
Declaration
Swift
@IBOutlet @MainActor weak var infoButton: WKInterfaceButton!
-
Called when the Scanning switch changes value
Declaration
Swift
@IBAction @MainActor func scanningSwitchChanged(_ inIsOn: Bool)Parameters
inIsOnTrue, if the switch is now on.
-
Establishes accessibility labels.
Declaration
Swift
@MainActor func setAccessibility()
-
Called as the View is set up.
Declaration
Swift
@MainActor override func awake(withContext inContext: Any?)Parameters
withContextThe context provided to the view, as it was instantiated.
-
Table touch handler.
Declaration
Swift
@MainActor override func contextForSegue(withIdentifier inSegueIdentifier: String, in inTable: WKInterfaceTable, rowIndex inRowIndex: Int) -> Any?Parameters
withIdentifierThe segue ID for this (we ignore)
inThe table instance
rowIndexThe 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
@MainActor override func willDisappear()
-
This adds devices to the table for display.
Declaration
Swift
@MainActor func populateTable()
-
This sets everything up to reflect the current state of the Central Manager.
Declaration
Swift
@MainActor override func updateUI()
View on GitHub