diff --git a/BluetoothExplorer/Controller/GATT Characteristic Editors/ModelNumberCharacteristicViewController.swift b/BluetoothExplorer/Controller/GATT Characteristic Editors/ModelNumberCharacteristicViewController.swift index c80ab19..8407725 100644 --- a/BluetoothExplorer/Controller/GATT Characteristic Editors/ModelNumberCharacteristicViewController.swift +++ b/BluetoothExplorer/Controller/GATT Characteristic Editors/ModelNumberCharacteristicViewController.swift @@ -31,7 +31,7 @@ final class ModelNumberCharacteristicViewController: UIViewController { // MARK: - Actions - @IBAction func textFieldEditingChanged(_ sender: Any) { + @IBAction func textFieldEditingChanged(_ sender: UITextField) { guard let text = modelTextField.text else { return } @@ -49,8 +49,9 @@ final class ModelNumberCharacteristicViewController: UIViewController { updateText() } - func updateText() { + private func updateText() { + modelTextField.isEnabled = valueDidChange != nil modelTextField.text = value.rawValue } } diff --git a/BluetoothExplorer/Controller/GATT Characteristic Editors/SystemIDCharacteristicViewController.swift b/BluetoothExplorer/Controller/GATT Characteristic Editors/SystemIDCharacteristicViewController.swift index 85fc3a9..4a85225 100644 --- a/BluetoothExplorer/Controller/GATT Characteristic Editors/SystemIDCharacteristicViewController.swift +++ b/BluetoothExplorer/Controller/GATT Characteristic Editors/SystemIDCharacteristicViewController.swift @@ -45,9 +45,12 @@ final class SystemIDCharacteristicViewController: UIViewController { guard let organizationallyUniqueIdentifier = UInt32(organizationallyUniqueIdentifierText) else { return } - value = GATTSystemID(manufacturerIdentifier: manufacturerIdentifier, - organizationallyUniqueIdentifier: organizationallyUniqueIdentifier)! -// valueDidChange?(value) + guard let systemID = GATTSystemID(manufacturerIdentifier: manufacturerIdentifier, + organizationallyUniqueIdentifier: organizationallyUniqueIdentifier) + else { return } + + value = systemID + valueDidChange?(value) } }