The interface for configuring and controlling a drag interaction.
SDKs
- iOS 11.0+
- Mac Catalyst 13.0+
Framework
- UIKit
Declaration
protocol UIDragInteractionDelegate
The interface for configuring and controlling a drag interaction.
SDKs
Framework
protocol UIDragInteractionDelegate
func drag Interaction(UIDrag Interaction, items For Beginning: UIDrag Session) -> [UIDrag Item]
Asks the delegate for the array of drag items for an impending drag interaction.
Required.
func drag Interaction(UIDrag Interaction, items For Adding To: UIDrag Session, with Touch At: CGPoint) -> [UIDrag Item]
Asks the delegate for the drag items to add to an in-progress drag session, in response to a user gesture to add the items.
func drag Interaction(UIDrag Interaction, session For Adding Items: [UIDrag Session], with Touch At: CGPoint) -> UIDrag Session?
Asks the delegate which drag session to add drag items to when there is more than one in-progress session.
func drag Interaction(UIDrag Interaction, will Animate Lift With: UIDrag Animating, session: UIDrag Session)
Tells the delegate the system's lift animation is about to start.
func drag Interaction(UIDrag Interaction, item: UIDrag Item, will Animate Cancel With: UIDrag Animating)
Tells the delegate the system's cancellation animation is about to start.
func drag Interaction(UIDrag Interaction, session Will Begin: UIDrag Session)
Tells the delegate the lift animation has finished and the user is starting to move the items across the screen.
func drag Interaction(UIDrag Interaction, session: UIDrag Session, will Add: [UIDrag Item], for: UIDrag Interaction)
Tells the delegate an interaction is about to add items to a drag session.
func drag Interaction(UIDrag Interaction, session Did Move: UIDrag Session)
Tells the delegate the user moved the drag items to a new location on the screen.
func drag Interaction(UIDrag Interaction, session: UIDrag Session, will End With: UIDrop Operation)
Tells the delegate the drag activity will end with the specified operation.
func drag Interaction(UIDrag Interaction, session: UIDrag Session, did End With: UIDrop Operation)
Tells the delegate the drag activity and its related animations have finished.
func drag Interaction(UIDrag Interaction, session Did Transfer Items: UIDrag Session)
Tells the delegate the destination view has received the data for the drag items.
func drag Interaction(UIDrag Interaction, preview For Lifting: UIDrag Item, session: UIDrag Session) -> UITargeted Drag Preview?
Asks the delegate for the targeted drag item preview that will appear during the lift animation.
func drag Interaction(UIDrag Interaction, preview For Cancelling: UIDrag Item, with Default: UITargeted Drag Preview) -> UITargeted Drag Preview?
Asks the delegate for the targeted drag item preview to show during the cancellation animation.
func drag Interaction(UIDrag Interaction, prefers Full Size Previews For: UIDrag Session) -> Bool
Asks the delegate whether the preview should appear in its original size or a scaled size.
func drag Interaction(UIDrag Interaction, session Is Restricted To Dragging Application: UIDrag Session) -> Bool
Asks the delegate whether the system should restrict the drag session to the app that started the session.
func drag Interaction(UIDrag Interaction, session Allows Move Operation: UIDrag Session) -> Bool
Asks the delegate whether the session allows the move operation.
protocol UIDrop Interaction Delegate
The interface for configuring and controlling a drop interaction.
class UIDrag Interaction
An interaction to enable dragging of items from a view, employing a delegate to provide drag items and to respond to calls from the drag session.
class UIDrop Interaction
An interaction to enable dropping of items onto a view, employing a delegate to instantiate objects and respond to calls from the drop session.