dragInteraction(_:sessionForAddingItems:withTouchAt:)
Asks the delegate which drag session to add drag items to when there is more than one in-progress session.
Declaration
optional func dragInteraction(_ interaction: UIDragInteraction, sessionForAddingItems sessions: [any UIDragSession], withTouchAt point: CGPoint) -> (any UIDragSession)?Parameters
- interaction:
The interaction that called this method.
- sessions:
An array of in-progress drag sessions.
- point:
The location of the user’s touch in the view. The touch point is in the view’s coordinate system.
Return Value
The drag session to add drag items to, or nil to continue without adding drag items to any drag session.
Discussion
If more than one drag session exists, the session used to add drag items may not be apparent to the user. Therefore, by default, no items are added to any session. If you want to change this behavior, implement this method and return the appropriate session. Return nil to continue without adding items.