Initializer

init(for:title:)

Initializes a drag item preview with a URL and title.

Declaration

convenience init(for 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

A drag preview for a URL that has a title.

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

See Also

Initializing a Drag Item Preview

init(view: UIView)

Initializes a new drag item preview with a view, using the default appearance parameters.

init(view: UIView, parameters: UIDragPreviewParameters)

Initializes a new drag item preview with a view and with a set of appearance parameters.

init(for: URL)

Initializes a new drag item preview with a URL.