Instance Method

peripheral(_:didWriteValueFor:error:)

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

Declaration

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

Parameters

peripheral

The peripheral providing this information.

characteristic

The characteristic whose value has been written.

error

If an error occurred, the cause of the failure.

Discussion

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