Instance Method

beginInteractiveMovementForItemAtIndexPath:

Initiates the interactive movement of the item at the specified index path.

Declaration

- (BOOL)beginInteractiveMovementForItemAtIndexPath:(NSIndexPath *)indexPath;

Parameters

indexPath

The index path of the item you want to move.

Return Value

YES if it is possible to move the item or NO if the item is not allowed to move.

Discussion

Call this method when you want to begin the interactive movement of an item from its current location to a new location within the same collection view. When using a gesture recognizer to track movements of the item, call this method from your handler method when the gesture recognition process begins. When interactions with the item end, you must call either the endInteractiveMovement or cancelInteractiveMovement method to inform the collection view of that fact.

When you call this method, the collection view consults its delegate to make sure the item can be moved. If the data source does not support the movement of the item, this method returns NO.

See Also

Reordering Items Interactively

- updateInteractiveMovementTargetPosition:

Updates the position of the item within the collection view’s bounds.

- endInteractiveMovement

Ends interactive movement tracking and moves the target item to its new location.

- cancelInteractiveMovement

Ends interactive movement tracking and returns the target item to its original location.