---
title: "init(forURL:title:)"
framework: uikit
role: symbol
role_heading: Initializer
path: "uikit/uidragpreview/init(forurl:title:)"
---

# init(forURL:title:)

Initializes a drag item preview with a URL and title.

## Declaration

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

## Parameters

- `url`: An Internet address referencing a remote resource, such as a webpage.
- `title`: A title for the URL.

## Return Value

Return Value A drag preview for a URL that has a title.

## Discussion

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:).

## See Also

### Initializing a drag item preview

- [init(view:)](uikit/uidragpreview/init(view:).md)
- [init(view:parameters:)](uikit/uidragpreview/init(view:parameters:).md)
- [init(forURL:)](uikit/uidragpreview/init(forurl:).md)
