CBMutableCharacteristic objects represent the characteristics of a local peripheral’s service (local peripheral devices are represented by CBPeripheralManager objects). This class adds write access to many of the properties in the CBCharacteristic class it inherits from.


class CBMutableCharacteristic : CBCharacteristic


You use this class to create a characteristic and to set its properties and permissions as desired. After you create a characteristic and add it to a local service, you can publish it (and the service) to the peripheral’s local database using the add(_:) method of the CBPeripheralManager class. After you publish a characteristic, the characteristic is cached and you can no longer make changes to it.


Initializing a Mutable Characteristic

init(type: CBUUID, properties: CBCharacteristicProperties, value: Data?, permissions: CBAttributePermissions)

Returns a newly initialized mutable characteristic with specified permissions, properties, and value.

Managing a Mutable Characteristic

var value: Data?

The value of the characteristic.

var descriptors: [CBDescriptor]?

A list of descriptors that describe the characteristic.

var properties: CBCharacteristicProperties

The properties of the characteristic.

var permissions: CBAttributePermissions

The permissions of the characteristic value.

var subscribedCentrals: [CBCentral]?

A list of centrals currently subscribed to the characteristic’s value.


struct CBAttributePermissions

Values representing the read, write, and encryption permissions for a characteristic’s value.


Inherits From

Conforms To