CGA_CharacteristicInteractionViewController

class CGA_CharacteristicInteractionViewController : CGA_BaseViewController, CGA_WriteableElementContainer
extension CGA_CharacteristicInteractionViewController: CGA_UpdatableScreenViewController
extension CGA_CharacteristicInteractionViewController: UITextViewDelegate

This controls the Interaction View.

  • This is a carriage return/linefeed pair, which will always be used in place of a simple CR or LF, alone.

    Declaration

    Swift

    private static let _crlf: String
  • This stack view contains the items at the top of the screen.

    Declaration

    Swift

    @IBOutlet
    weak var writeStackView: UIStackView!
  • This is the label for the write section.

    Declaration

    Swift

    @IBOutlet
    weak var writeLabel: UILabel!
  • This button will send the data.

    Declaration

    Swift

    @IBOutlet
    weak var writeSendButton: UIButton!
  • This contains the response switch and button label.

    Declaration

    Swift

    @IBOutlet
    weak var responseContainer: UIStackView!
  • This button toggles the switch value, and acts like a label.

    Declaration

    Swift

    @IBOutlet
    weak var responseLabelButton: UIButton!
  • This switch denotes whether or not to request a response to the write.

    Declaration

    Swift

    @IBOutlet
    weak var responseSwitch: UISwitch!
  • This is the text view that receives text to be written.

    Declaration

    Swift

    @IBOutlet
    weak var writeTextView: UITextView!
  • This holds the vartious read/indicate stuff.

    Declaration

    Swift

    @IBOutlet
    weak var readStackView: UIStackView!
  • This button triggers a read.

    Declaration

    Swift

    @IBOutlet
    weak var readButton: UIButton!
  • This text view displays the read data as a string.

    Declaration

    Swift

    @IBOutlet
    weak var readTextView: UITextView!
  • This button toggles notification state.

    Declaration

    Swift

    @IBOutlet
    weak var notifyButton: UIButton!
  • The Characteristic that is associated with this view controller.

    Declaration

    Swift

    var writeableElementInstance: CGA_Bluetooth_Writable?
  • The Characteristic that is associated with this view controller, cast from the writable entity.

    Declaration

    Swift

    var myCharacteristicInstance: CGA_Bluetooth_Characteristic? { get }

Private Methods

  • This sets up the accessibility and voiceover strings for the screen.

    Declaration

    Swift

    func setUpAccessibility()

IBAction Handlers

  • This reacts to a tap in the area outside the keyboard, and puts away the keyboard.

    Declaration

    Swift

    @IBAction
    func tappedInScreen(_: Any! = nil)
  • Declaration

    Swift

    @IBAction
    func writeSendButtonHit(_: Any! = nil)
  • Declaration

    Swift

    @IBAction
    func responseButtonHit(_: Any! = nil)
  • Declaration

    Swift

    @IBAction
    func readButtonHit(_: Any! = nil)
  • Declaration

    Swift

    @IBAction
    func notifyButtonHit(_: Any! = nil)

Base Class Override

  • Called when the view hierarchy has been loaded from the nib.

    Declaration

    Swift

    override func viewDidLoad()

CGA_UpdatableScreenViewController Conformance

  • This simply makes sure that the UI matches the state of the Characteristic.

    Declaration

    Swift

    func updateUI()

Text View Delegate

  • Called when some text or attributes change in the text view.

    Declaration

    Swift

    func textViewDidChange(_ inTextView: UITextView)

    Parameters

    inTextView

    The Text View that experienced the change.