<!--
{
  "availability" : [
    "iOS: 11.0.0 -",
    "iPadOS: 11.0.0 -",
    "macCatalyst: 13.1.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UITextDragPreviewRenderer/init(layoutManager:range:unifyRects:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UITextDragPreviewRenderer(im)initWithLayoutManager:range:unifyRects:"
  },
  "title" : "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.

```
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 [`firstLineRect`](/documentation/UIKit/UITextDragPreviewRenderer/firstLineRect), [`bodyRect`](/documentation/UIKit/UITextDragPreviewRenderer/bodyRect), and [`lastLineRect`](/documentation/UIKit/UITextDragPreviewRenderer/lastLineRect) properties adjust; otherwise, they don’t. The default value is `true`.

## Return Value

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

## Discussion

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)