<!--
{
  "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/CBPeripheralManager/respond(to:withResult:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Core Bluetooth"
    ],
    "preciseIdentifier" : "c:objc(cs)CBPeripheralManager(im)respondToRequest:withResult:"
  },
  "title" : "respond(to:withResult:)"
}
-->

# respond(to:withResult:)

Responds to a read or write request from a connected central.

```
func respond(to request: CBATTRequest, withResult result: CBATTError.Code)
```

## Parameters

`request`

The read or write request received from the connected central. For more information about read and write requests, see [`CBATTRequest`](/documentation/CoreBluetooth/CBATTRequest).

`result`

The result of attempting to fulfill the request. For a list of possible results, see [Deprecated Constants](/documentation/CoreBluetooth/deprecated-constants).

## Discussion

When the peripheral manager receives a request from a connected central to read or write a characteristic’s value, it calls the [`peripheralManager(_:didReceiveRead:)`](/documentation/CoreBluetooth/CBPeripheralManagerDelegate/peripheralManager(_:didReceiveRead:)) or [`peripheralManager(_:didReceiveWrite:)`](/documentation/CoreBluetooth/CBPeripheralManagerDelegate/peripheralManager(_:didReceiveWrite:)) method of its delegate object. To respond to the corresponding read or write request, you call this method whenever you recevie one of these delegate method callbacks.

---

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)