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

# init(forURL:target:)

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

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

## Parameters

`url`

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

`target`

A drag item preview target.

## Return Value

A targeted drag preview for a URL based on the drag item preview target.

## Discussion

This method creates a targeted drag item preview of the URL. The URL preview is a one-line, textual representation that might not show the full URL string. Don’t use a file URL.

---

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)