Contents

deselectAll(_:)

Deselects all items in the collection view.

Declaration

@IBAction func deselectAll(_ sender: Any?)

Parameters

  • sender:

    The object that requested the action. You may specify nil for this property.

Discussion

This method works only when the isSelectable and allowsEmptySelection properties are both true true. If either property is set to false, this method quietly does nothing and any connected menu item is disabled.

This method consults the delegate object regarding the selection. Specifically, it calls the delegate’s collectionView(_:shouldDeselectItemsAt:) method to see if the items should be selected. For any items that are selected, it calls the collectionView(_:didDeselectItemsAt:) method.

See Also

Managing the Selection