---
title: "init(string:attributes:range:)"
framework: uikit
role: symbol
role_heading: Initializer
path: "uikit/nstextlinefragment/init(string:attributes:range:)"
---

# init(string:attributes:range:)

Creates a new line fragment using the string, attributes, and range you provide.

## Declaration

```swift
convenience init(string: String, attributes: [NSAttributedString.Key : Any] = [:], range: NSRange)
```

## Parameters

- `string`: An attributed string.
- `attributes`: A dictionary of attributes.
- `range`: The range to use from string.

## See Also

### Creating line fragments

- [init(attributedString:range:)](uikit/nstextlinefragment/init(attributedstring:range:).md)
- [init(coder:)](uikit/nstextlinefragment/init(coder:).md)
