---
title: "discoverServices(_:)"
framework: corebluetooth
role: symbol
role_heading: Instance Method
path: "corebluetooth/cbperipheral/discoverservices(_:)"
---

# discoverServices(_:)

Discovers the specified services of the peripheral.

## Declaration

```swift
func discoverServices(_ serviceUUIDs: [CBUUID]?)
```

## Parameters

- `serviceUUIDs`: An array of doc://com.apple.corebluetooth/documentation/CoreBluetooth/CBUUID objects that you are interested in. Each doc://com.apple.corebluetooth/documentation/CoreBluetooth/CBUUID object represents a UUID that identifies the type of service you want to discover.

## Discussion

Discussion You can provide an array of CBUUID objects—representing service UUIDs—in the serviceUUIDs parameter. When you do, the peripheral returns only the services of the peripheral that match the provided UUIDs. note: If the servicesUUIDs parameter is nil, this method returns all of the peripheral’s available services. This is much slower than providing an array of service UUIDs to search for. When the peripheral discovers one or more services, it calls the peripheral(_:didDiscoverServices:): method of its delegate object. After a peripheral discovers services, you can access them through the peripheral’s services property.

## See Also

### Discovering Services

- [discoverIncludedServices(_:for:)](corebluetooth/cbperipheral/discoverincludedservices(_:for:).md)
- [services](corebluetooth/cbperipheral/services.md)
