---
title: "subscript(_:)"
framework: swiftui
role: symbol
role_heading: Instance Subscript
path: "swiftui/text/layout/run/subscript(_:)"
---

# subscript(_:)

The custom attribute of type T associated with the run of glyphs, or nil. If no run contains the custom attribute we also check its attachment’s runs.

## Declaration

```swift
subscript<T>(key: T.Type) -> T? where T : TextAttribute { get }
```
