---
title: "init(textMarkupAttributes:)"
framework: avfoundation
role: symbol
role_heading: Initializer
path: "avfoundation/avtextstylerule/init(textmarkupattributes:)"
---

# init(textMarkupAttributes:)

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

## Declaration

```swift
convenience init?(textMarkupAttributes: [String : Any] = [:])
```

## 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

Return Value A text style rule object initialized with the specified attributes.

## Discussion

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.

## See Also

### Creating and initializing style rules

- [textStyleRules(fromPropertyList:)](avfoundation/avtextstylerule/textstylerules(frompropertylist:).md)
- [init(textMarkupAttributes:textSelector:)](avfoundation/avtextstylerule/init(textmarkupattributes:textselector:).md)
