Instance Method

collectionView:didBeginMultipleSelectionInteractionAtIndexPath:

Tells the delegate when the user starts using a two-finger pan gesture to select multiple items in a collection view.

Declaration

- (void)collectionView:(UICollectionView *)collectionView didBeginMultipleSelectionInteractionAtIndexPath:(NSIndexPath *)indexPath;

Parameters

collectionView

The collection view calling this method.

indexPath

The index path of the item that the user touched to start the two-finger pan gesture.

Discussion

Your implementation of this method is a good place to indicate, in the app’s user interface, that the user is selecting multiple items; for example, you could replace an Edit or Select button with a Done button.

func collectionView(_ collectionView: UICollectionView, didBeginMultipleSelectionInteractionAt indexPath: IndexPath) {
    // Replace the Select button with Done, and put the 
    // collection view into editing mode.
    setEditing(true, animated: true)
}

See Also

Managing the Selected Cells

Changing the Appearance of Selected and Highlighted Cells

Provide visual feedback to the user about the state of a cell and the transition between states.

Selecting Multiple Items with a Two-Finger Pan Gesture

Accelerate user selection of multiple items using the multiselect gesture on table and collection views.

- collectionView:shouldSelectItemAtIndexPath:

Asks the delegate if the specified item should be selected.

- collectionView:didSelectItemAtIndexPath:

Tells the delegate that the item at the specified index path was selected.

- collectionView:shouldDeselectItemAtIndexPath:

Asks the delegate if the specified item should be deselected.

- collectionView:didDeselectItemAtIndexPath:

Tells the delegate that the item at the specified path was deselected.

- collectionView:shouldBeginMultipleSelectionInteractionAtIndexPath:

Asks the delegate whether the user can select multiple items using a two-finger pan gesture in a collection view.

- collectionViewDidEndMultipleSelectionInteraction:

Tells the delegate when the user stops using a two-finger pan gesture to select multiple items in a collection view.