---
title: "init(layoutManager:range:unifyRects:)"
framework: uikit
role: symbol
role_heading: Initializer
path: "uikit/uitextdragpreviewrenderer/init(layoutmanager:range:unifyrects:)"
---

# init(layoutManager:range:unifyRects:)

Returns an initialized renderer of a text drag preview with the specified layout manager, range, and rectangle detection behavior.

## Declaration

```swift
init(layoutManager: NSLayoutManager, range: NSRange, unifyRects: Bool)
```

## Parameters

- `layoutManager`: The layout manager that renders the preview.
- `range`: The range to render the preview.
- `unifyRects`: A Boolean value that indicates whether the vertical position and height of the detection rectangles adjust to touch each other. If true, the doc://com.apple.uikit/documentation/UIKit/UITextDragPreviewRenderer/firstLineRect, doc://com.apple.uikit/documentation/UIKit/UITextDragPreviewRenderer/bodyRect, and doc://com.apple.uikit/documentation/UIKit/UITextDragPreviewRenderer/lastLineRect properties adjust; otherwise, they don’t. The default value is true.

## Return Value

Return Value A renderer of a text drag preview using the specified layout manager, range, and detection behavior.

## See Also

### Initializing a text drag preview renderer

- [init(layoutManager:range:)](uikit/uitextdragpreviewrenderer/init(layoutmanager:range:).md)
