---
title: "dragInteraction(_:previewForCancelling:withDefault:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uidraginteractiondelegate/draginteraction(_:previewforcancelling:withdefault:)"
---

# dragInteraction(_:previewForCancelling:withDefault:)

Asks the delegate for the targeted drag item preview to show during the cancellation animation.

## Declaration

```swift
optional func dragInteraction(_ interaction: UIDragInteraction, previewForCancelling item: UIDragItem, withDefault defaultPreview: UITargetedDragPreview) -> UITargetedDragPreview?
```

## Parameters

- `interaction`: The interaction that called this method.
- `item`: The drag item represented by the preview.
- `defaultPreview`: A targeted drag preview provided by the system.

## Return Value

Return Value

The default preview provided by the system. A targeted drag item preview you create. The preview returned after moving to a new preview target (using the defaultPreview’s retargetedPreview(with:) method). nil to fade the preview that is currently displayed to the user, which is the same behavior as not implementing this method.

## Discussion

Discussion The system calls this method multiple times, once for each visible drag item. When you return a preview, the system shows it during the cancellation animation in order to visually “move” the drag item to the location of the preview’s associated view.

## See Also

### Providing drag previews

- [dragInteraction(_:previewForLifting:session:)](uikit/uidraginteractiondelegate/draginteraction(_:previewforlifting:session:).md)
- [dragInteraction(_:prefersFullSizePreviewsFor:)](uikit/uidraginteractiondelegate/draginteraction(_:prefersfullsizepreviewsfor:).md)
