<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "macOS: 12.0.0 -",
    "tvOS: 15.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 8.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/ScopedAttributeContainer",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "s:10Foundation24ScopedAttributeContainerV"
  },
  "title" : "ScopedAttributeContainer"
}
-->

# ScopedAttributeContainer

An attribute container that allows dynamic member lookup of its contents within the specified attribute scope.

```
@dynamicMemberLookup struct ScopedAttributeContainer<S> where S : AttributeScope
```

## Overview

Use a [`ScopedAttributeContainer`](/documentation/Foundation/ScopedAttributeContainer) when you need to disambiguate between attributes that exist in several attribute scopes that your app uses.

## Topics

### Accessing Attribute Keys

[`subscript<T>(dynamicMember _: KeyPath<S, T>) -> T.Value?`](/documentation/Foundation/ScopedAttributeContainer/subscript(dynamicMember:))

Returns the value of the attribute that the specified key path indicates.

## Relationships

### Conforms To

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

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

---

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)