Animates the item to the specified location and inserts a placeholder cell at that location.
- iOS 11.0+
- Mac Catalyst 13.0+
The drag item containing the data to drop.
The placeholder to add at the specified location.
The context object that you use to replace or remove the placeholder cell later. Store a reference to this object so that you can call its methods later.
Use this method to insert a temporary placeholder cell (instead of a cell backed by actual data) into the collection view. When calling this method, don’t update your data source object to account for the placeholder. The collection view manages the placeholder until you explicitly remove it using the returned context object.
Typically, you use this method when you must load data asynchronously for a cell. Instead of updating your data source, you insert a placeholder cell. When the data is finally available, update your data source object and call the
commit method of the returned context object to swap out the placeholder cell for an actual cell. You can also remove a placeholder cell that’s no longer needed by calling the
At some point after calling this method, the collection view executes your
cell block. Use that block to configure the contents of the placeholder cell. Calling the
set method of the returned context object executes your handler again, giving you a way to update the cell later.