CBMutable objects represent the descriptors of a local peripheral’s characteristic (local peripheral devices are represented by
- iOS 6.0+
- macOS 10.9+
- tvOS 9.0+
- watchOS 2.0+
- Core Bluetooth
You use the
CBMutable class to create a local characteristic descriptor. After you create a descriptor and associate it with a local characteristic, you can publish it (along with the characteristic and local service to which it belongs) to the peripheral’s local database via the
add(_:) method of the
CBPeripheral class. After you publish a local descriptor, the descriptor is cached and you can no longer make changes to it.
There are six predefined types of descriptors that—along with their corresponding value types—are detailed in
CBUUID. That said, only two of these are currently supported when creating local, mutable descriptors: the characteristic user description descriptor and the characteristic format descriptor, represented by the
CBUUIDCharacteristic, respectively. The system automatically creates the characteristic extended properties descriptor and the client characteristic configuration descriptor, depending on the properties of the characteristic to which the descriptor belongs.