<!--
{
  "availability" : [
    "iOS: 27.2.0 -",
    "iPadOS: 27.2.0 -",
    "macCatalyst: 27.2.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "HomeExtensions",
  "identifier" : "/documentation/HomeExtensions/HomeContext",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "HomeExtensions"
    ],
    "preciseIdentifier" : "s:14HomeExtensions0A7ContextC"
  },
  "title" : "HomeContext"
}
-->

# HomeContext

The context in which the Home app launches your extension, including the selected home and accessory.

```
@MainActor final class HomeContext
```

## Overview

You access the context from the environment with `@Environment(\.homeContext)`. The context is available in the SwiftUI environment while the extension is running.

## Topics

### Getting context

[`var accessory: HMAccessory?`](/documentation/HomeExtensions/HomeContext/accessory)

The accessory that a person selected in the Home app.

[`var home: HMHome?`](/documentation/HomeExtensions/HomeContext/home)

The home that a person selected in the Home app.

### Working with the navigation stack

[`let navigator: HomeNavigator`](/documentation/HomeExtensions/HomeContext/navigator)

The navigator for pushing pages onto the Home app’s navigation stack.

[`func dismiss() async`](/documentation/HomeExtensions/HomeContext/dismiss())

Asks the Home app to dismiss your extension’s content.

### Reading extension metadata

[`var metadata: [String : String]`](/documentation/HomeExtensions/HomeContext/metadata)

Additional information that the Home app provides about the content it’s displaying.

[`enum MetadataKey`](/documentation/HomeExtensions/HomeContext/MetadataKey)

Keys for values in the context’s metadata.

### Completing configuration

[`func reportConfigurationComplete() async`](/documentation/HomeExtensions/HomeContext/reportConfigurationComplete())

Tells the Home app that the accessory’s configuration is complete.

### Debugging

[`var description: String`](/documentation/HomeExtensions/HomeContext/description)

A textual description of the context, for debugging.

### Operators

[`static func == (HomeContext, HomeContext) -> Bool`](/documentation/HomeExtensions/HomeContext/==(_:_:))

Returns a Boolean value that indicates whether two contexts are equal.

## Relationships

### Conforms To

[`Copyable`](/documentation/Swift/Copyable)

[`Sendable`](/documentation/Swift/Sendable)

[`Observable`](/documentation/Observation/Observable)

[`Equatable`](/documentation/Swift/Equatable)

[`Escapable`](/documentation/Swift/Escapable)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

---

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)