RVS_BTDriver_iOS_Test_Harness_MainTableViewController
class RVS_BTDriver_iOS_Test_Harness_MainTableViewController : RVS_BTDriver_iOS_Test_Harness_Base_ViewController
extension RVS_BTDriver_iOS_Test_Harness_MainTableViewController: RVS_BTDriverDelegate
extension RVS_BTDriver_iOS_Test_Harness_MainTableViewController: RVS_BTDriver_DeviceSubscriberProtocol
extension RVS_BTDriver_iOS_Test_Harness_MainTableViewController: UITableViewDataSource
extension RVS_BTDriver_iOS_Test_Harness_MainTableViewController: UITableViewDelegate
-
The table cell prototype reuse ID
Declaration
Swift
let cellReuseIDentifier: String -
The segue that will bring in a device details page.
Declaration
Swift
let displaySegueID: String -
This is the index that indicates the segmented Switch is in “not scanning” mode.
Declaration
Swift
static let segmentedSwitchIsOffIndex: Int -
This is the index that indicates the segmented Switch is in “scanning” mode.
Declaration
Swift
static let segmentedSwitchIsOnIndex: Int -
The color to use for the segmented switch when not scanning.
Declaration
Swift
static let redSelectedColor: UIColor -
The color to use for the segmented switch when scanning.
Declaration
Swift
static let greenSelectedColor: UIColor -
This is set to true, if the app was scanning before it segued.
Declaration
Swift
internal var internal_wasScanning: Bool -
The image that we display if there is no Bluetooth available.
Declaration
Swift
@IBOutlet weak var noBTImageView: UIImageView! -
The container view for the controls and table, available if there is an active Bluetooth connection.
Declaration
Swift
@IBOutlet weak var activeBTItemContainerView: UIView! -
The table that displays discovered devices.
Declaration
Swift
@IBOutlet weak var devicesTableView: UITableView! -
The scanning/not scanning switch.
Declaration
Swift
@IBOutlet weak var scanModeSegmentedSwitch: UISegmentedControl! -
This is required for the subscriber support.
Declaration
Swift
var _uuid: UUID!
-
The scanning/not scanning switch changed.
Declaration
Swift
@IBAction func scanModeSwitchChanged(_ inSwitch: UISegmentedControl)Parameters
inSwitchThe switch instance.
-
Called when the driver encounters an error.
Declaration
Swift
public func btDriver(_ inDriver: RVS_BTDriver, encounteredThisError inError: RVS_BTDriver.Errors)Parameters
inDriverThe driver instance making the callback.
encounteredThisErrorThe error that was encountered.
-
Called when the device encounters an error.
Declaration
Swift
func subscribedDevice(_ inDevice: RVS_BTDriver_DeviceProtocol, encounteredThisError inError: RVS_BTDriver.Errors)Parameters
inDeviceThe device instance making the callback.
encounteredThisErrorThe error that was encountered.
-
Called when a new service is added to the device instance.
Declaration
Swift
public func device(_ inDevice: RVS_BTDriver_DeviceProtocol, serviceAdded inService: RVS_BTDriver_ServiceProtocol)Parameters
inDeviceThe device instance making the callback.
serviceAddedThe new service that was added to the device.
-
Called when the device wants us to update our status.
Declaration
Swift
public func deviceStatusUpdate(_ inDevice: RVS_BTDriver_DeviceProtocol)Parameters
inDeviceThe device instance making the callback.
-
Called when the device encounters an error.
Declaration
Swift
public func device(_ inDevice: RVS_BTDriver_DeviceProtocol, encounteredThisError inError: RVS_BTDriver.Errors)Parameters
inDeviceThe device instance making the callback.
encounteredThisErrorThe error that was encountered.
-
Declaration
Swift
func tableView(_ inTableView: UITableView, numberOfRowsInSection inSection: Int) -> IntParameters
inTableViewThe table view that called this.
numberOfRowsInSectionAn integer, with the 0-based section (always 0).
Return Value
The number of rows (number of devices).
-
Called to create a cell instance to populate a table cell.
Declaration
Swift
func tableView(_ inTableView: UITableView, cellForRowAt inIndexPath: IndexPath) -> UITableViewCellParameters
inTableViewThe table view that called this.
cellForRowAtAn IndexPath to the selected cell that needs populating.
Return Value
A newly-created cell instance.
-
This is called when someone taps on a row.
We bring in the inspector for that device, and deselect the row.
Declaration
Swift
func tableView(_ inTableView: UITableView, willSelectRowAt inIndexPath: IndexPath) -> IndexPath?Parameters
inTableViewThe table view that called this.
willSelectRowAtAn IndexPath to the selected row.
Return Value
An IndexPath, if the row is to remain selected and highlighted. It is always false, and we immediately deselect the row, anyway.
-
Indicate that a row can be edited (for left-swipe delete).
Declaration
Swift
func tableView(_ inTableView: UITableView, canEditRowAt inIndexPath: IndexPath) -> BoolParameters
inTableViewThe table view being checked
canEditRowAtThe indexpath of the row to be checked.
Return Value
true, always.
-
Called to do a delete action.
Declaration
Swift
func tableView(_ inTableView: UITableView, commit inEditingStyle: UITableViewCell.EditingStyle, forRowAt inIndexPath: IndexPath)Parameters
inTableViewThe table view being checked
commitThe action to perform.
forRowAtThe indexpath of the row to be deleted.
-
Called after the view has completely loaded.
Declaration
Swift
override func viewDidLoad() -
Called just before the view is to lay out its various subviews.
Declaration
Swift
override func viewWillLayoutSubviews() -
This is called when the screen is about to appear.
Declaration
Swift
override func viewWillAppear(_ inAnimated: Bool) -
This is called as we prepare to open the device inspector screen. We use it to associate the device instance with the screen.
Declaration
Swift
override func prepare(for inSegue: UIStoryboardSegue, sender inSender: Any?)Parameters
forThe segue object.
senderThe context we attached to the segue (the device object).
-
Sets up the UI Items.
Declaration
Swift
func setup()
View on GitHub
RVS_BTDriver_iOS_Test_Harness_MainTableViewController Class Reference