<!--
{
  "availability" : [
    "iOS: 6.0.0 -",
    "iPadOS: 6.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.9.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreBluetooth",
  "identifier" : "/documentation/CoreBluetooth/CBPeripheralManagerDelegate/peripheralManager(_:didReceiveWrite:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Core Bluetooth"
    ],
    "preciseIdentifier" : "c:objc(pl)CBPeripheralManagerDelegate(im)peripheralManager:didReceiveWriteRequests:"
  },
  "title" : "peripheralManager(_:didReceiveWrite:)"
}
-->

# peripheralManager(_:didReceiveWrite:)

Tells the delegate that a local peripheral device received an Attribute Protocol (ATT) write request for a characteristic with a dynamic value.

```
optional func peripheralManager(_ peripheral: CBPeripheralManager, didReceiveWrite requests: [CBATTRequest])
```

## Parameters

`peripheral`

The peripheral manager that received the request.

`requests`

A list of one or more [`CBATTRequest`](/documentation/CoreBluetooth/CBATTRequest) objects, each representing a request to write the value of a characteristic.

## Discussion

In the same way that you respond to a read request, each time you receive this callback, call the [`respond(to:withResult:)`](/documentation/CoreBluetooth/CBPeripheralManager/respond(to:withResult:)) method of the [`CBPeripheralManager`](/documentation/CoreBluetooth/CBPeripheralManager) class exactly once. If the `requests` parameter contains multiple requests, treat them as you would a single request—if you can’t fulfill an individual request, you shouldn’t fulfill any of them. Instead, call the [`respond(to:withResult:)`](/documentation/CoreBluetooth/CBPeripheralManager/respond(to:withResult:)) method immediately, and provide a result that indicates the cause of the failure.

When you respond to a write request, note that the first parameter of the [`respond(to:withResult:)`](/documentation/CoreBluetooth/CBPeripheralManager/respond(to:withResult:)) method expects a single [`CBATTRequest`](/documentation/CoreBluetooth/CBATTRequest) object, even though you received an array of them from the [`peripheralManager(_:didReceiveWrite:)`](/documentation/CoreBluetooth/CBPeripheralManagerDelegate/peripheralManager(_:didReceiveWrite:)) method. To respond properly, pass in the first request of the `requests` array.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)