Instance Method

collectionView(_:shouldSpringLoadItemAt:with:)

Returns a Boolean value indicating whether you want the spring-loading interaction effect displayed for the specified item.

Declaration

optional func collectionView(_ collectionView: UICollectionView, shouldSpringLoadItemAt indexPath: IndexPath, with context: UISpringLoadedInteractionContext) -> Bool

Parameters

collectionView

The collection view object notifying you of the interaction.

indexPath

The index path of the item for which the spring-loading behavior applies.

context

A context object containing information about the item and view on which to display the spring-loading interaction.

Return Value

true to apply the spring-loading behavior for the item or false to suppress the behavior altogether.

Discussion

If you do not implement this method, the collection view assumes a return value of true.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software