CGA_SettingsViewController
@MainActor
class CGA_SettingsViewController : CGA_BaseViewController
extension CGA_SettingsViewController: UITextViewDelegate
This controls the settings view.
-
This switch will determine whether or not duplicate filtering is applied to the Peripheral scanning. If it is applied, then duplicates will be ignored during the discovery process (meaning that the devices are not continuously updated). False/Off means that duplicates ARE being filtered.
Declaration
Swift
@IBOutlet @MainActor weak var ignoreDuplicatesScanningSwitch: UISwitch! -
This button is the “label” for the switch. I always like my labels to actuate their targets. This toggles the value of the switch.
Declaration
Swift
@IBOutlet @MainActor weak var ignoreDuplicatesSwitchButton: UIButton! -
The label for the header over the three TextFields.
Declaration
Swift
@IBOutlet @MainActor weak var filterHeaderLabel: UILabel! -
The Label for the device/Peripheral filter TextField.
Declaration
Swift
@IBOutlet @MainActor weak var deviceFilterLabel: UILabel! -
The TextField for entry of the device/Peripheral filters.
Declaration
Swift
@IBOutlet @MainActor weak var deviceFilterTextView: UITextView! -
The Label for the Service filter TextField.
Declaration
Swift
@IBOutlet @MainActor weak var serviceFilterLabel: UILabel! -
The TextField for entry of the Service filters.
Declaration
Swift
@IBOutlet @MainActor weak var serviceFilterTextView: UITextView! -
The Label for the Characteristic filter TextField.
Declaration
Swift
@IBOutlet @MainActor weak var characteristicFilterLabel: UILabel! -
The TextField for entry of the Characteristic filters.
Declaration
Swift
@IBOutlet @MainActor weak var characteristicFilterTextView: UITextView! -
The Label for the Minimum RSSI threshold.
Declaration
Swift
@IBOutlet @MainActor weak var minimumRSSILevelLabel: UILabel! -
The Label for the Left (minimum) RSSI threshold.
Declaration
Swift
@IBOutlet @MainActor weak var minimumRSSILevelMinValLabel: UILabel! -
The Label for the Right (maximum) RSSI threshold.
Declaration
Swift
@IBOutlet @MainActor weak var minimumRSSILevelMaxValLabel: UILabel! -
The Label for the Current Value of the Minimum RSSI threshold.
Declaration
Swift
@IBOutlet @MainActor weak var minimumRSSILevelValueLabel: UILabel! -
The Slider for the Minimum RSSI threshold.
Declaration
Swift
@IBOutlet @MainActor weak var minimumRSSILevelSlider: UISlider! -
This switch will determine whether or not filtering is applied to the Peripheral scanning, ignoring devices that can’t be connected. If it is applied, then any device that does not advertise that it can be connected will be ignored. False/Off means that all connectables and non-connectables are being discovered. True/On means that only connectable devices will be listed.
Declaration
Swift
@IBOutlet @MainActor weak var onlyConnectablesSwitch: UISwitch! -
This button is the “label” for the switch. I always like my labels to actuate their targets. This toggles the value of the switch.
Declaration
Swift
@IBOutlet @MainActor weak var onlyConnectablesSwitchButton: UIButton! -
This button controls whether or not to filter out empty names.
Declaration
Swift
@IBOutlet @MainActor weak var emptyNamesSwitch: UISwitch! -
This button is the “label” for the switch. I always like my labels to actuate their targets. This toggles the value of the switch.
Declaration
Swift
@IBOutlet @MainActor weak var emptyNamesSwitchButton: UIButton! -
This switch controls whether or not to always send endlines as CRLF pairs.
Declaration
Swift
@IBOutlet @MainActor weak var alwaysUseCRLFSwitch: UISwitch! -
This button is the “label” for the switch. I always like my labels to actuate their targets. This toggles the value of the switch.
Declaration
Swift
@IBOutlet @MainActor weak var alwaysUseCRLFSwitchButton: UIButton!
-
This is a utility method that “scrubs” the contents of the passed-in text, so it is an Array of String, containing valid UUID values.
Declaration
Swift
@MainActor private class func _parseThisTextForUUIDs(_ inTextToParse: String!) -> [String]Parameters
inTextToParseThe String to be parsed. The Array will be formed from split by linefeed (“\n”).
Return Value
an Array of String, containing the UUIDs extracted from the text.
-
This sets up the accessibility and voiceover strings for the screen.
Declaration
Swift
@MainActor func setUpAccessibility()
-
Called when the “Continuous Scan” switch is hit. This immediately updates our prefs.
Declaration
Swift
@IBAction @MainActor func ignoreDuplicatesSwitchHit(_ inSwitch: UISwitch)Parameters
inSwitchThe switch object.
-
Called when the label for the switch is hit. It toggles the value in the prefs, and forces a UI update, which will change the switch.
Declaration
Swift
@IBAction @MainActor func ignoreDuplicatesButtonHit(_: Any) -
Declaration
Swift
@IBAction @MainActor func minimumRSSISliderChanged(_ inSlider: UISlider)Parameters
inSliderThe slider instance.
-
This dismisses any open keyboard.
Declaration
Swift
@IBAction @MainActor func dismissKeyboard(_: Any! = nil) -
Called when the “Only Connectable Devices” switch is hit. This immediately updates our prefs.
Declaration
Swift
@IBAction @MainActor func onlyConnectableSwitchHit(_ inSwitch: UISwitch)Parameters
inSwitchThe switch object.
-
Called when the label for the switch is hit. It toggles the value in the prefs, and forces a UI update, which will change the switch.
Declaration
Swift
@IBAction @MainActor func onlyConnectableButtonHit(_: Any) -
Called when the “Allow Empty Names” switch is hit. This immediately updates our prefs.
Declaration
Swift
@IBAction @MainActor func emptyNamesSwitchHit(_ inSwitch: UISwitch)Parameters
inSwitchThe switch object.
-
Called when the label for the switch is hit. It toggles the value in the prefs, and forces a UI update, which will change the switch.
Declaration
Swift
@IBAction @MainActor func emptyNamesButtonHit(_: Any) -
Called when the “Always Use CRLF” switch is hit. This immediately updates our prefs.
Declaration
Swift
@IBAction @MainActor func alwaysUseCRLFSwitchHit(_ inSwitch: UISwitch)Parameters
inSwitchThe switch object.
-
Called when the label for the switch is hit. It toggles the value in the prefs, and forces a UI update, which will change the switch.
Declaration
Swift
@IBAction @MainActor func alwaysUseCRLFButtonHit(_: Any)
-
Updates all the values to match the prefs.
Declaration
Swift
@MainActor func updateUI() -
Declaration
Swift
@MainActor func updateMInimumRSSIValue() -
Forces a prefs update on the contents of the Peripheral filter TextView.
Declaration
Swift
@MainActor func parseDeviceTextView() -
Forces a prefs update on the contents of the Service filter TextView.
Declaration
Swift
@MainActor func parseServiceTextView() -
Forces a prefs update on the contents of the Characteristic filter TextView.
Declaration
Swift
@MainActor func parseCharacteristicTextView()
-
Called after the view data has been loaded.
Declaration
Swift
@MainActor override func viewDidLoad() -
Called before the view is displayed. We use this to ensure that the orientation is portrait.
Declaration
Swift
@MainActor override func viewWillAppear(_ inAnimated: Bool)Parameters
inAnimatedignored.
-
This allows us to restart scanning in the main screen, if it was running before we were called. It also allows us to restore the orientation.
Declaration
Swift
@MainActor override func viewDidDisappear(_ inAnimated: Bool)Parameters
inAnimatedignored.
-
Called when any of the TextFields change. We use this to parse the values.
Declaration
Swift
@MainActor func textViewDidChange(_ inTextView: UITextView)Parameters
inTextViewThe TextView that is being changed.
View on GitHub