<!--
{
  "availability" : [
    "iOS: 18.0.0 -",
    "iPadOS: 18.0.0 -",
    "macCatalyst: -",
    "macOS: 15.0.0 -",
    "visionOS: 26.0.0 -",
    "watchOS: 11.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "WidgetKit",
  "identifier" : "/documentation/WidgetKit/WidgetRelevanceAttribute/init(configuration:context:)-8325r",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "WidgetKit"
    ],
    "preciseIdentifier" : "s:9WidgetKit0A18RelevanceAttributeVAASo8INIntentCRbzlE13configuration7contextACyxGx_0cB015RelevantContextVtcfc"
  },
  "title" : "init(configuration:context:)"
}
-->

# init(configuration:context:)

Creates a new widget relevance for a specific configuration that is
relevant in a specific context.

```
init(configuration: Configuration, context: RelevantContext)
```

## Parameters

`configuration`

The specific configuration

`context`

the relevant context where this widget is relevant.

## Discussion

For example, a weather widget could specify that a configuration for
a specific location is relevant for a the relevant context at that
specific location.

---

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)