<!--
{
  "availability" : [
    "iOS: 18.0.0 -",
    "iPadOS: 18.0.0 -",
    "macCatalyst: 15.0.0 -",
    "macOS: 12.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AVFoundation",
  "identifier" : "/documentation/AVFoundation/AVCaption",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "AVFoundation"
    ],
    "preciseIdentifier" : "c:objc(cs)AVCaption"
  },
  "title" : "AVCaption"
}
-->

# AVCaption

An object that represents text to present over a time range.

```
class AVCaption
```

## Overview

A caption contains a cue, which is a single sentence or paragraph of text for a time range in the video timeline. Within the active range, the caption may animate (for example, Karaoke lyrics) by rolling-up, changing visibility, or using other dynamic styling.

## Topics

### Creating a caption

[`init(_:timeRange:)`](/documentation/AVFoundation/AVCaption/init(_:timeRange:))

Creates a caption that contains text and a time range.

### Accessing text and timing

[`text`](/documentation/AVFoundation/AVCaption/text)

The caption text.

[`timeRange`](/documentation/AVFoundation/AVCaption/timeRange)

The time range over which the system presents the caption.

### Accessing the region

[`region`](/documentation/AVFoundation/AVCaption/region)

The region in which the caption exists.

### Accessing font styles

[`fontStyle(at:)`](/documentation/AVFoundation/AVCaption/fontStyle(at:))

Returns the font style and range at the index position.

[`fontStyleAtIndex:range:`](/documentation/AVFoundation/AVCaption/fontStyleAtIndex:range:)

Returns the font style and range at the index position.

[`AVCaption.FontStyle`](/documentation/AVFoundation/AVCaption/FontStyle)

Font styles for caption text.

[`fontWeight(at:)`](/documentation/AVFoundation/AVCaption/fontWeight(at:))

Returns the font weight and range at the index position.

[`fontWeightAtIndex:range:`](/documentation/AVFoundation/AVCaption/fontWeightAtIndex:range:)

Returns the font weight and range at the index position.

[`AVCaption.FontWeight`](/documentation/AVFoundation/AVCaption/FontWeight)

Font weights for a caption.

[`decoration(at:)`](/documentation/AVFoundation/AVCaption/decoration(at:))

Returns the text decoration at the index position.

[`decorationAtIndex:range:`](/documentation/AVFoundation/AVCaption/decorationAtIndex:range:)

Returns the text decoration at the index position.

[`AVCaption.Decoration`](/documentation/AVFoundation/AVCaption/Decoration)

Text decorations for caption text.

### Accessing colors

[`textColor(at:)`](/documentation/AVFoundation/AVCaption/textColor(at:))

Returns the text color at the index position.

[`backgroundColor(at:)`](/documentation/AVFoundation/AVCaption/backgroundColor(at:))

Returns the background color at the index position.

[`textColorAtIndex:range:`](/documentation/AVFoundation/AVCaption/textColorAtIndex:range:)

Returns the text color at the index position.

[`backgroundColorAtIndex:range:`](/documentation/AVFoundation/AVCaption/backgroundColorAtIndex:range:)

Returns the background color at the index position.

### Accessing alignment

[`textAlignment`](/documentation/AVFoundation/AVCaption/textAlignment-swift.property)

The alignment for the caption text.

[`AVCaption.TextAlignment`](/documentation/AVFoundation/AVCaption/TextAlignment-swift.enum)

Text alignment options for a caption.

### Accessing animation

[`animation`](/documentation/AVFoundation/AVCaption/animation-swift.property)

The animation that the system applies to this caption.

[`AVCaption.Animation`](/documentation/AVFoundation/AVCaption/Animation-swift.enum)

Animation options for a caption.

### Accessing advanced typography

[`ruby(at:)`](/documentation/AVFoundation/AVCaption/ruby(at:))

Returns the ruby text at the index position.

[`rubyAtIndex:range:`](/documentation/AVFoundation/AVCaption/rubyAtIndex:range:)

Returns the ruby text at the index position.

[`AVCaption.Ruby`](/documentation/AVFoundation/AVCaption/Ruby)

An object that presents ruby characters.

[`textCombine(at:)`](/documentation/AVFoundation/AVCaption/textCombine(at:))

Returns the text combine at the index position.

[`textCombineAtIndex:range:`](/documentation/AVFoundation/AVCaption/textCombineAtIndex:range:)

Returns the text combine at the index position.

[`AVCaption.TextCombine`](/documentation/AVFoundation/AVCaption/TextCombine)

The caption’s supported rendering policy options.



---

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)