---
title: "subscript(dynamicMember:)"
framework: foundation
role: symbol
role_heading: Instance Subscript
path: "foundation/discontiguousattributedsubstring/subscript(dynamicmember:)-89pug"
---

# subscript(dynamicMember:)

Returns a scoped attribute container that a key path indicates.

## Declaration

```swift
subscript<S>(dynamicMember keyPath: KeyPath<AttributeScopes, S.Type>) -> ScopedAttributeContainer<S> where S : AttributeScope { get set }
```
