---
title: "updateName(_:completionHandler:)"
framework: homekit
role: symbol
role_heading: Instance Method
path: "homekit/hmaccessory/updatename(_:completionhandler:)"
---

# updateName(_:completionHandler:)

Changes the name of the accessory.

## Declaration

```swift
func updateName(_ name: String, completionHandler completion: @escaping @Sendable ((any Error)?) -> Void)
```

```swift
func updateName(_ name: String) async throws
```

## Parameters

- `name`: The new name.
- `completion`: The block executed after the request is processed.

## See Also

### Identifying an Accessory

- [name](homekit/hmaccessory/name.md)
- [uniqueIdentifier](homekit/hmaccessory/uniqueidentifier.md)
- [identifier](homekit/hmaccessory/identifier.md)
