---
title: "add(_:)"
framework: corebluetooth
role: symbol
role_heading: Instance Method
path: "corebluetooth/cbperipheralmanager/add(_:)"
---

# add(_:)

Publishes a service and any of its associated characteristics and characteristic descriptors to the local GATT database.

## Declaration

```swift
func add(_ service: CBMutableService)
```

## Parameters

- `service`: The service you want to publish.

## Discussion

Discussion When you add a service to the database, the peripheral manager calls the peripheralManager(_:didAdd:error:) method of its delegate object. If the service contains any included services, you must first publish them.

## See Also

### Adding and Removing Services

- [remove(_:)](corebluetooth/cbperipheralmanager/remove(_:).md)
- [removeAllServices()](corebluetooth/cbperipheralmanager/removeallservices().md)
