<!--
{
  "availability" : [
    "iOS: 26.4.0 -",
    "iPadOS: 26.4.0 -",
    "macCatalyst: 26.4.0 -",
    "macOS: 26.4.0 -",
    "tvOS: 26.4.0 -",
    "visionOS: 26.4.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AVFoundation",
  "identifier" : "/documentation/AVFoundation/AVCaptionRenderer/captionPreview(forProfileID:extendedLanguageTag:renderSize:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "AVFoundation"
    ],
    "preciseIdentifier" : "c:objc(cs)AVCaptionRenderer(cm)captionPreviewForProfileID:extendedLanguageTag:renderSize:"
  },
  "title" : "captionPreview(forProfileID:extendedLanguageTag:renderSize:)"
}
-->

# captionPreview(forProfileID:extendedLanguageTag:renderSize:)

Generate a caption preview attributed string for the specified profile ID.

```
class func captionPreview(forProfileID profileID: String, extendedLanguageTag: String?, renderSize: CGSize) -> NSAttributedString
```

## Parameters

`profileID`

The identifier of the accessibility profile to use for caption appearance. Profile IDs can be obtained from MACaptionAppearanceCopyProfileIDs(). This determines font, color, background, and other visual characteristics.

`extendedLanguageTag`

The IETF BCP 47 (RFC 4646) language identifier that will be used to generate the localized caption preview text. If nil, the system language will be used.

`renderSize`

The size of the layer into which the captions will be rendered. This determines the layout and positioning of the caption text.

## Return Value

An NSAttributedString containing the caption preview.

## Discussion

Returns an attributed string containing a preview of captions rendered using the specified profile ID.

> Important: It is strongly recommended that the caller take appropriate measures to prevent blocking essential services such as the user interface, for example, by avoiding calling this method in the main thread.

---

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)