---
title: "peripheral(_:didDiscoverIncludedServicesFor:error:)"
framework: corebluetooth
role: symbol
role_heading: Instance Method
path: "corebluetooth/cbperipheraldelegate/peripheral(_:diddiscoverincludedservicesfor:error:)"
---

# peripheral(_:didDiscoverIncludedServicesFor:error:)

Tells the delegate that discovering included services within the indicated service completed.

## Declaration

```swift
optional func peripheral(_ peripheral: CBPeripheral, didDiscoverIncludedServicesFor service: CBService, error: (any Error)?)
```

## Parameters

- `peripheral`: The peripheral providing this information.
- `service`: The doc://com.apple.corebluetooth/documentation/CoreBluetooth/CBService object containing the included service.
- `error`: The reason the call failed, or nil if no error occurred.

## Discussion

Discussion Core Bluetooth invokes this method when your app calls the discoverIncludedServices(_:for:) method. If the peripheral successfully discovers services, you can access them through the service’s includedServices property. If successful, the error parameter is nil. If unsuccessful, the error parameter returns the cause of the failure.

## See Also

### Discovering Services

- [peripheral(_:didDiscoverServices:)](corebluetooth/cbperipheraldelegate/peripheral(_:diddiscoverservices:).md)
