<!--
{
  "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/Ruby",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "AVFoundation"
    ],
    "preciseIdentifier" : "c:objc(cs)AVCaptionRuby"
  },
  "title" : "AVCaption.Ruby"
}
-->

# AVCaption.Ruby

An object that presents ruby characters.

```
class Ruby
```

## Overview

Ruby characters are small annotations, typically used in Japanese content, that render alongside the base text.

## Topics

### Creating Ruby text

[`-  initWithText:`](/documentation/AVFoundation/AVCaption/Ruby/init(text:))

Creates ruby text.

[`-  initWithText:position:alignment:`](/documentation/AVFoundation/AVCaption/Ruby/init(text:position:alignment:))

Creates ruby text with position and alignment.

### Accessing text properties

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

The ruby text.

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

The ruby text position.

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

Constants that indicate ruby text positions.

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

The ruby text alignment.

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

Constants that indicate ruby text alignments.

## Relationships

### Conforms To

[`CVarArg`](/documentation/Swift/CVarArg)

[`Sendable`](/documentation/Swift/Sendable)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`NSCoding`](/documentation/Foundation/NSCoding)

[`Equatable`](/documentation/Swift/Equatable)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`Hashable`](/documentation/Swift/Hashable)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`NSSecureCoding`](/documentation/Foundation/NSSecureCoding)

[`NSCopying`](/documentation/Foundation/NSCopying)

### Inherits From

[`NSObject-swift.class`](/documentation/ObjectiveC/NSObject-swift.class)

---

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)