<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "swift: -",
    "visionOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UITargetedDragPreview/init(forURL:title:target:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UITargetedDragPreview(cm)previewForURL:title:target:::SYNTHESIZED::c:objc(cs)UITargetedDragPreview"
  },
  "title" : "init(forURL:title:target:)"
}
-->

# init(forURL:title:target:)

Initializes a new targeted drag item preview with a URL, a title, and a drag item preview.

```
convenience init(forURL url: URL, title: String?, target: UIDragPreviewTarget)
```

## Parameters

`url`

An Internet address referencing a remote resource, such as a webpage.

`title`

A title for the URL.

`target`

A drag item preview target.

## Return Value

A drag preview for a URL with a title based on the specified drag item preview target.

## Discussion

This method creates a two-line drag item preview, with the title displayed on the first line. The second line is a textual representation of the URL that might not show the full URL string. Don’t use a file URL. Passing `nil` for the title is the same as calling [`init(forURL:target:)`](/documentation/UIKit/UITargetedDragPreview/init(forURL:target:)).

---

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)