<!--
{
  "availability" : [
    "iOS: 8.0.0 - 9.0.0",
    "iPadOS: 8.0.0 - 9.0.0",
    "visionOS: 1.0.0 - 1.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "HomeKit",
  "identifier" : "/documentation/HomeKit/HMHome/addUser(completionHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "HomeKit"
    ],
    "preciseIdentifier" : "c:objc(cs)HMHome(im)addUserWithCompletionHandler:"
  },
  "title" : "addUser(completionHandler:)"
}
-->

# addUser(completionHandler:)

Adds a user to the home.

```
func addUser(completionHandler completion: @escaping @Sendable (HMUser?, (any Error)?) -> Void)
```

## Parameters

`completion`

The block executed after the request is processed.

- user: The user that was added to the home.
- error: `nil` on success; otherwise, error object indicating the reason for failure. `error.userInfo[HMUserFailedAccessoriesKey]` contains more information in case of failure. See [`HMUserFailedAccessoriesKey`](/documentation/HomeKit/HMUserFailedAccessoriesKey) for more details.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)