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

# init(attributedString:range:)

Creates a new line fragment from the attributed string for the range of characters you specify.

## Declaration

```swift
init(attributedString: NSAttributedString, range: NSRange)
```

## Parameters

- `attributedString`: The attributed string.
- `range`: An doc://com.apple.documentation/documentation/Foundation/NSRange-c.struct that specifies which characters to include.

## See Also

### Creating line fragments

- [init(coder:)](uikit/nstextlinefragment/init(coder:).md)
- [init(string:attributes:range:)](uikit/nstextlinefragment/init(string:attributes:range:).md)
