AVTextStyleRule Class Reference
| Inherits from | |
| Conforms to | |
| Framework | /System/Library/Frameworks/AVFoundation.framework |
| Availability | Available in iOS 6.0 and later. |
| Declared in | AVTextStyleRule.h |
Overview
An AVTextStyleRule object represents text styling rules that can be applied to text in a media item. You use text style objects to format subtitles, closed captions, and other text-related content of the item. The rules you specify can be applied to all or part of the text in the media item.
Tasks
Creating and Initializing Style Rules
-
+ textStyleRulesFromPropertyList: -
+ textStyleRuleWithTextMarkupAttributes: -
+ textStyleRuleWithTextMarkupAttributes:textSelector: -
– initWithTextMarkupAttributes: -
– initWithTextMarkupAttributes:textSelector:
Accessing the Style Attributes
-
textMarkupAttributesproperty -
textSelectorproperty
Exporting the Style Rules
Properties
textMarkupAttributes
A dictionary of text style attributes to apply to the text. (read-only)
Discussion
The supported keys for this dictionary are defined in CMTextMarkup.h.
Availability
- Available in iOS 6.0 and later.
Declared In
AVTextStyleRule.htextSelector
A string that identifies the text to which the attributes should apply. (read-only)
Discussion
The contents of the string are determined by the format of the legible media. For example, the string could contain the CSS selectors used by the corresponding text in Web Video Text Tracks (WebVTT) markup.
If the value of this property is nil, the text style attributes apply to all text in the media item.
Availability
- Available in iOS 6.0 and later.
Declared In
AVTextStyleRule.hClass Methods
propertyListForTextStyleRules:
Converts one or more text style rules into a serializable property list object.
Parameters
- textStyleRules
An array of
AVTextStyleRuleobjects to write to the property list.
Return Value
A property-list object that you can pass to the NSPropertyListSerialization serialization routines.
Discussion
The property-list object returned by this method can be written to disk and stored persistently.
Availability
- Available in iOS 6.0 and later.
See Also
Declared In
AVTextStyleRule.htextStyleRulesFromPropertyList:
Creates an array of text style rule objects from the specified property-list object.
Parameters
- plist
A property-list object containing the text style data.
Return Value
An array of AVTextStyleRule objects corresponding to the style information in the property-list object.
Discussion
Use this method to create new text style rule objects based on data you previously converted to a property-list format using the propertyListForTextStyleRules: class method.
Availability
- Available in iOS 6.0 and later.
See Also
Declared In
AVTextStyleRule.htextStyleRuleWithTextMarkupAttributes:
Creates and returns a new text style rule object using the style attributes in the specified dictionary.
Parameters
- textMarkupAttributes
A dictionary of style attributes. For a list of supported keys and values that you can include in this dictionary, see
CMTextMarkup.h.
Return Value
A new text style rule object with the specified attributes.
Discussion
This method sets the textSelector property of the style object to nil, which causes the rules to be applied to all of the text in the media item.
Availability
- Available in iOS 6.0 and later.
Declared In
AVTextStyleRule.htextStyleRuleWithTextMarkupAttributes:textSelector:
Creates and returns a new text style rule object using the specified style attributes and text range information.
Parameters
- textMarkupAttributes
A dictionary of style attributes. For a list of supported keys and values that you can include in this dictionary, see
CMTextMarkup.h.- textSelector
A string contains an identifier for the ranges of text to which the style attributes should be applied. Eligible identifiers are determined by the media format and its corresponding text content. For example, the string could contain the CSS selectors used by the corresponding text in Web Video Text Tracks (WebVTT) markup. Specify
nilif you want the style attributes to apply to all text in the item.
Return Value
A new text style rule object with the specified attributes and range information.
Availability
- Available in iOS 6.0 and later.
Declared In
AVTextStyleRule.hInstance Methods
initWithTextMarkupAttributes:
Initializes a text style rule object with the specified style attributes.
Parameters
- textMarkupAttributes
A dictionary of style attributes. For a list of supported keys and values that you can include in this dictionary, see
CMTextMarkup.h.
Return Value
A text style rule object initialized with the specified attributes.
Discussion
This method sets the textSelector property of the style object to nil, which causes the rules to be applied to all of the text in the media item.
Availability
- Available in iOS 6.0 and later.
Declared In
AVTextStyleRule.hinitWithTextMarkupAttributes:textSelector:
Initializes a text style rule object with the specified style attributes and text range information.
Parameters
- textMarkupAttributes
A dictionary of style attributes. For a list of supported keys and values that you can include in this dictionary, see
CMTextMarkup.h.- textSelector
A string contains an identifier for the ranges of text to which the style attributes should be applied. Eligible identifiers are determined by the media format and its corresponding text content. For example, the string could contain the CSS selectors used by the corresponding text in Web Video Text Tracks (WebVTT) markup. Specify
nilif you want the style attributes to apply to all text in the item.
Return Value
A text style rule object initialized with the specified attributes and range information.
Availability
- Available in iOS 6.0 and later.
Declared In
AVTextStyleRule.h© 2012 Apple Inc. All Rights Reserved. (Last updated: 2012-09-19)