Contents

collectionView(_:dropSessionDidEnter:)

Notifies you when dragged content enters the collection view’s bounds rectangle.

Declaration

optional func collectionView(_ collectionView: UICollectionView, dropSessionDidEnter session: any UIDropSession)

Parameters

  • collectionView:

    The collection view that’s tracking the dragged content.

  • session:

    The drop session object containing information about the type of data being dragged.

Discussion

The collection view calls this method when dragged content enters its bounds rectangle. The method isn’t called again until the dragged content exits the collection view’s bounds (triggering a call to the collectionView(_:dropSessionDidExit:) method) and enters again.

Use this method to perform any one-time setup associated with tracking dragged content over the collection view.

See Also

Tracking the drag movements