An object that represents text styling rules applied to text in a media item.


class AVTextStyleRule : NSObject


You use text style objects to format subtitles, closed captions, and other text-related content of the item. The system applies these rules to all or part of the text of the media item.


Creating and Initializing Style Rules

class func textStyleRules(fromPropertyList: Any) -> [AVTextStyleRule]?

Creates an array of text style rule objects from the specified property-list object.

init?(textMarkupAttributes: [String : Any])

Creates a text style rule object with the specified style attributes.

init?(textMarkupAttributes: [String : Any], textSelector: String?)

Creates a text style rule object with the specified style attributes and text range information.

Accessing the Style Attributes

var textMarkupAttributes: [String : Any]

A dictionary of text style attributes to apply to the text.

var textSelector: String?

A string that identifies the text to which the attributes should apply.

Exporting the Style Rules

class func propertyList(for: [AVTextStyleRule]) -> Any

Converts one or more text style rules into a serializable property list object.


Inherits From