---
title: "performAccessorySetup(using:completionHandler:)"
framework: homekit
role: symbol
role_heading: Instance Method
path: "homekit/hmaccessorysetupmanager/performaccessorysetup(using:completionhandler:)"
---

# performAccessorySetup(using:completionHandler:)

Performs the process of setting up accessories with Apple Home.

## Declaration

```swift
func performAccessorySetup(using request: HMAccessorySetupRequest, completionHandler completion: @escaping @Sendable (HMAccessorySetupResult?, (any Error)?) -> Void)
```

```swift
func performAccessorySetup(using request: HMAccessorySetupRequest) async throws -> HMAccessorySetupResult
```

## Parameters

- `request`: The accessory setup request.
- `completion`: A block that the framework invokes once the setup process completes.

## Discussion

Discussion During the setup process, the framework adds each accessory to a home, assigns it to a room, and provides further configuration based on its services.
