Instance Method


Invoked when you write data to a characteristic’s value.


optional func peripheral(_ peripheral: CBPeripheral, didWriteValueFor characteristic: CBCharacteristic, error: Error?)



The peripheral providing this information.


The characteristic whose value has been written.


If an error occurred, the cause of the failure.


This method is invoked only when your app calls the writeValue(_:for:type:) method with the CBCharacteristicWriteType.withResponse constant specified as the write type. If successful, the error parameter is nil. If unsuccessful, the error parameter returns the cause of the failure.

See Also

Writing Characteristic and Characteristic Descriptor Values

func peripheral(CBPeripheral, didWriteValueFor: CBDescriptor, error: Error?)

Invoked when you write data to a characteristic descriptor’s value.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software