---
title: "init(contents:markerAttributes:textList:children:)"
framework: uikit
role: symbol
role_heading: Initializer
path: "uikit/nstextlistelement/init(contents:markerattributes:textlist:children:)"
---

# init(contents:markerAttributes:textList:children:)

Creates a text list element with the list elements, nesting level, and marker attributes you provide.

## Declaration

```swift
convenience init(contents: NSAttributedString, markerAttributes: [NSAttributedString.Key : Any]? = nil, textList: NSTextList, children: [NSTextListElement]?)
```

## Parameters

- `contents`: An doc://com.apple.documentation/documentation/Foundation/NSAttributedString that contains the contents of the text list element.
- `markerAttributes`: A dictionary of doc://com.apple.documentation/documentation/Foundation/NSAttributedString/Key keys and IDs that describe the marker attributes.
- `textList`: The doc://com.apple.uikit/documentation/UIKit/NSTextList to add elements to.
- `children`: An array of doc://com.apple.uikit/documentation/UIKit/NSTextListElement elements.

## See Also

### Create a text list element

- [init(children:textList:nestingLevel:)](uikit/nstextlistelement/init(children:textlist:nestinglevel:).md)
- [init(parent:textList:contents:markerAttributes:children:)](uikit/nstextlistelement/init(parent:textlist:contents:markerattributes:children:).md)
