Package apple.uikit.protocol
Interface UICollectionViewDelegate
-
- All Superinterfaces:
UIScrollViewDelegate
- All Known Subinterfaces:
UICollectionViewDelegateFlowLayout
- All Known Implementing Classes:
UICollectionViewController
public interface UICollectionViewDelegate extends UIScrollViewDelegate
-
-
Method Summary
-
Methods inherited from interface apple.uikit.protocol.UIScrollViewDelegate
scrollViewDidChangeAdjustedContentInset, scrollViewDidEndDecelerating, scrollViewDidEndDraggingWillDecelerate, scrollViewDidEndScrollingAnimation, scrollViewDidEndZoomingWithViewAtScale, scrollViewDidScroll, scrollViewDidScrollToTop, scrollViewDidZoom, scrollViewShouldScrollToTop, scrollViewWillBeginDecelerating, scrollViewWillBeginDragging, scrollViewWillBeginZoomingWithView, scrollViewWillEndDraggingWithVelocityTargetContentOffset, viewForZoomingInScrollView
-
-
-
-
Method Detail
-
collectionViewCanFocusItemAtIndexPath
default boolean collectionViewCanFocusItemAtIndexPath(UICollectionView collectionView, NSIndexPath indexPath)
Focus
-
collectionViewCanPerformActionForItemAtIndexPathWithSender
default boolean collectionViewCanPerformActionForItemAtIndexPathWithSender(UICollectionView collectionView, org.moe.natj.objc.SEL action, NSIndexPath indexPath, java.lang.Object sender)
-
collectionViewDidDeselectItemAtIndexPath
default void collectionViewDidDeselectItemAtIndexPath(UICollectionView collectionView, NSIndexPath indexPath)
-
collectionViewDidEndDisplayingCellForItemAtIndexPath
default void collectionViewDidEndDisplayingCellForItemAtIndexPath(UICollectionView collectionView, UICollectionViewCell cell, NSIndexPath indexPath)
-
collectionViewDidEndDisplayingSupplementaryViewForElementOfKindAtIndexPath
default void collectionViewDidEndDisplayingSupplementaryViewForElementOfKindAtIndexPath(UICollectionView collectionView, UICollectionReusableView view, java.lang.String elementKind, NSIndexPath indexPath)
-
collectionViewDidHighlightItemAtIndexPath
default void collectionViewDidHighlightItemAtIndexPath(UICollectionView collectionView, NSIndexPath indexPath)
-
collectionViewDidSelectItemAtIndexPath
default void collectionViewDidSelectItemAtIndexPath(UICollectionView collectionView, NSIndexPath indexPath)
-
collectionViewDidUnhighlightItemAtIndexPath
default void collectionViewDidUnhighlightItemAtIndexPath(UICollectionView collectionView, NSIndexPath indexPath)
-
collectionViewDidUpdateFocusInContextWithAnimationCoordinator
default void collectionViewDidUpdateFocusInContextWithAnimationCoordinator(UICollectionView collectionView, UICollectionViewFocusUpdateContext context, UIFocusAnimationCoordinator coordinator)
-
collectionViewPerformActionForItemAtIndexPathWithSender
default void collectionViewPerformActionForItemAtIndexPathWithSender(UICollectionView collectionView, org.moe.natj.objc.SEL action, NSIndexPath indexPath, java.lang.Object sender)
-
collectionViewShouldDeselectItemAtIndexPath
default boolean collectionViewShouldDeselectItemAtIndexPath(UICollectionView collectionView, NSIndexPath indexPath)
called when the user taps on an already-selected item in multi-select mode
-
collectionViewShouldHighlightItemAtIndexPath
default boolean collectionViewShouldHighlightItemAtIndexPath(UICollectionView collectionView, NSIndexPath indexPath)
Methods for notification of selection/deselection and highlight/unhighlight events. The sequence of calls leading to selection from a user touch is: (when the touch begins) 1. -collectionView:shouldHighlightItemAtIndexPath: 2. -collectionView:didHighlightItemAtIndexPath: (when the touch lifts) 3. -collectionView:shouldSelectItemAtIndexPath: or -collectionView:shouldDeselectItemAtIndexPath: 4. -collectionView:didSelectItemAtIndexPath: or -collectionView:didDeselectItemAtIndexPath: 5. -collectionView:didUnhighlightItemAtIndexPath:
-
collectionViewShouldSelectItemAtIndexPath
default boolean collectionViewShouldSelectItemAtIndexPath(UICollectionView collectionView, NSIndexPath indexPath)
-
collectionViewShouldShowMenuForItemAtIndexPath
default boolean collectionViewShouldShowMenuForItemAtIndexPath(UICollectionView collectionView, NSIndexPath indexPath)
These methods provide support for copy/paste actions on cells. All three should be implemented if any are.
-
collectionViewShouldUpdateFocusInContext
default boolean collectionViewShouldUpdateFocusInContext(UICollectionView collectionView, UICollectionViewFocusUpdateContext context)
-
collectionViewTargetContentOffsetForProposedContentOffset
default CGPoint collectionViewTargetContentOffsetForProposedContentOffset(UICollectionView collectionView, CGPoint proposedContentOffset)
customize the content offset to be applied during transition or update animations
-
collectionViewTargetIndexPathForMoveFromItemAtIndexPathToProposedIndexPath
default NSIndexPath collectionViewTargetIndexPathForMoveFromItemAtIndexPathToProposedIndexPath(UICollectionView collectionView, NSIndexPath originalIndexPath, NSIndexPath proposedIndexPath)
-
collectionViewTransitionLayoutForOldLayoutNewLayout
default UICollectionViewTransitionLayout collectionViewTransitionLayoutForOldLayoutNewLayout(UICollectionView collectionView, UICollectionViewLayout fromLayout, UICollectionViewLayout toLayout)
support for custom transition layout
-
collectionViewWillDisplayCellForItemAtIndexPath
default void collectionViewWillDisplayCellForItemAtIndexPath(UICollectionView collectionView, UICollectionViewCell cell, NSIndexPath indexPath)
-
collectionViewWillDisplaySupplementaryViewForElementKindAtIndexPath
default void collectionViewWillDisplaySupplementaryViewForElementKindAtIndexPath(UICollectionView collectionView, UICollectionReusableView view, java.lang.String elementKind, NSIndexPath indexPath)
-
indexPathForPreferredFocusedViewInCollectionView
default NSIndexPath indexPathForPreferredFocusedViewInCollectionView(UICollectionView collectionView)
-
collectionViewShouldSpringLoadItemAtIndexPathWithContext
default boolean collectionViewShouldSpringLoadItemAtIndexPathWithContext(UICollectionView collectionView, NSIndexPath indexPath, UISpringLoadedInteractionContext context)
Allows opting-out of spring loading for an particular item. If you want the interaction effect on a different subview of the spring loaded cell, modify the context.targetView property. The default is the cell. If this method is not implemented, the default is YES.
-
collectionViewContextMenuConfigurationForItemAtIndexPathPoint
default UIContextMenuConfiguration collectionViewContextMenuConfigurationForItemAtIndexPathPoint(UICollectionView collectionView, NSIndexPath indexPath, CGPoint point)
Called when the interaction begins.- Parameters:
collectionView- This UICollectionView.indexPath- IndexPath of the item for which a configuration is being requested.point- Location in the collection view's coordinate space- Returns:
- A UIContextMenuConfiguration describing the menu to be presented. Return nil to prevent the interaction from beginning. Returning an empty configuration causes the interaction to begin then fail with a cancellation effect. You might use this to indicate to users that it's possible for a menu to be presented from this element, but that there are no actions to present at this particular time.
-
collectionViewDidBeginMultipleSelectionInteractionAtIndexPath
default void collectionViewDidBeginMultipleSelectionInteractionAtIndexPath(UICollectionView collectionView, NSIndexPath indexPath)
Called right after allowsMultipleSelection is set to YES if -collectionView:shouldBeginMultipleSelectionInteractionAtIndexPath: returned YES. In your app, this would be a good opportunity to update the state of your UI to reflect the fact that the user is now selecting multiple items at once; such as updating buttons to say "Done" instead of "Select"/"Edit", for instance.
-
collectionViewPreviewForDismissingContextMenuWithConfiguration
default UITargetedPreview collectionViewPreviewForDismissingContextMenuWithConfiguration(UICollectionView collectionView, UIContextMenuConfiguration configuration)
Called when the interaction is about to dismiss. Return a UITargetedPreview describing the desired dismissal target. The interaction will animate the presented menu to the target. Use this to customize the dismissal animation.- Parameters:
collectionView- This UICollectionView.configuration- The configuration of the menu displayed by this interaction.
-
collectionViewPreviewForHighlightingContextMenuWithConfiguration
default UITargetedPreview collectionViewPreviewForHighlightingContextMenuWithConfiguration(UICollectionView collectionView, UIContextMenuConfiguration configuration)
Called when the interaction begins. Return a UITargetedPreview describing the desired highlight preview.- Parameters:
collectionView- This UICollectionView.configuration- The configuration of the menu about to be displayed by this interaction.
-
collectionViewShouldBeginMultipleSelectionInteractionAtIndexPath
default boolean collectionViewShouldBeginMultipleSelectionInteractionAtIndexPath(UICollectionView collectionView, NSIndexPath indexPath)
Allows a two-finger pan gesture to automatically enable allowsMultipleSelection and start selecting multiple cells. After a multi-select gesture is recognized, this method will be called before allowsMultipleSelection is automatically set to YES to allow the user to select multiple contiguous items using a two-finger pan gesture across the constrained scroll direction. If the collection view has no constrained scroll direction (i.e., the collection view scrolls both horizontally and vertically), then this method will not be called and the multi-select gesture will be disabled. If this method is not implemented, the default is NO.
-
collectionViewWillPerformPreviewActionForMenuWithConfigurationAnimator
default void collectionViewWillPerformPreviewActionForMenuWithConfigurationAnimator(UICollectionView collectionView, UIContextMenuConfiguration configuration, UIContextMenuInteractionCommitAnimating animator)
Called when the interaction is about to "commit" in response to the user tapping the preview.- Parameters:
collectionView- This UICollectionView.configuration- Configuration of the currently displayed menu.animator- Commit animator. Add animations to this object to run them alongside the commit transition.
-
collectionViewDidEndMultipleSelectionInteraction
default void collectionViewDidEndMultipleSelectionInteraction(UICollectionView collectionView)
Called when the multi-select interaction ends. At this point, the collection view will remain in multi-select mode, but this delegate method is called to indicate that the multiple selection gesture or hardware keyboard interaction has ended.
-
collectionViewCanEditItemAtIndexPath
default boolean collectionViewCanEditItemAtIndexPath(UICollectionView collectionView, NSIndexPath indexPath)
Editing Asks the delegate to verify that the given item is editable.- Parameters:
collectionView- The collection view object requesting this information.indexPath- An index path locating an item in `collectionView`.- Returns:
- `YES` if the item is editable; otherwise, `NO`. Defaults to `YES`.
-
collectionViewWillDisplayContextMenuWithConfigurationAnimator
default void collectionViewWillDisplayContextMenuWithConfigurationAnimator(UICollectionView collectionView, UIContextMenuConfiguration configuration, UIContextMenuInteractionAnimating animator)
Called when the collection view is about to display a menu.- Parameters:
collectionView- This UICollectionView.configuration- The configuration of the menu about to be displayed.animator- Appearance animator. Add animations to run them alongside the appearance transition.
-
collectionViewWillEndContextMenuInteractionWithConfigurationAnimator
default void collectionViewWillEndContextMenuInteractionWithConfigurationAnimator(UICollectionView collectionView, UIContextMenuConfiguration configuration, UIContextMenuInteractionAnimating animator)
Called when the collection view's context menu interaction is about to end.- Parameters:
collectionView- This UICollectionView.configuration- Ending configuration.animator- Disappearance animator. Add animations to run them alongside the disappearance transition.
-
-