<!--
{
  "documentType" : "article",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/text-attributes-for-attributed-strings",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "Text attributes for attributed strings"
}
-->

# Text attributes for attributed strings

Apply attributes to text in an attributed string to convey extra information about the text.

## Topics

### Constants

  <doc://com.apple.documentation/documentation/Foundation/NSAttributedString/Key/accessibilityTextCustom>

  <doc://com.apple.documentation/documentation/Foundation/NSAttributedString/Key/accessibilityTextHeadingLevel>

  <doc://com.apple.documentation/documentation/Foundation/NSAttributedString/Key/UIAccessibilityTextAttributeContext>

### Constants

[`UIAccessibilityTextAttributeCustom`](/documentation/UIKit/UIAccessibilityTextAttributeCustom)

A key for specifying custom attributes to apply to the text.

[`UIAccessibilityTextAttributeHeadingLevel`](/documentation/UIKit/UIAccessibilityTextAttributeHeadingLevel)

A key for specifying the heading level of the text.

[`UIAccessibilityTextAttributeContext`](/documentation/UIKit/UIAccessibilityTextAttributeContext)



---

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)