---
title: "peripheral(_:didUpdateValueFor:error:)"
framework: corebluetooth
role: symbol
role_heading: Instance Method
path: "corebluetooth/cbperipheraldelegate/peripheral(_:didupdatevaluefor:error:)-1t3wm"
---

# peripheral(_:didUpdateValueFor:error:)

Tells the delegate that retrieving a specified characteristic descriptor’s value succeeded.

## Declaration

```swift
optional func peripheral(_ peripheral: CBPeripheral, didUpdateValueFor descriptor: CBDescriptor, error: (any Error)?)
```

## Parameters

- `peripheral`: The peripheral providing this information.
- `descriptor`: The characteristic descriptor containing the value.
- `error`: The reason the call failed, or nil if no error occurred.

## Discussion

Discussion Core Bluetooth invokes this method when your app calls the readValue(for:) method. If successful, the error parameter is nil. If unsuccessful, the error parameter returns the cause of the failure.

## See Also

### Retrieving Characteristic and Descriptor Values

- [peripheral(_:didUpdateValueFor:error:)](corebluetooth/cbperipheraldelegate/peripheral(_:didupdatevaluefor:error:)-1xyna.md)
