Repository navigation
[Delegate] implement additional context menu APIs #1
Copy link
Copy link
Open
Labels
Description
Activity
- added a commit that references this issue
on Sep 13, 2021 currently, only implementing:
public func collectionView( _ collectionView: UICollectionView, contextMenuConfigurationForItemAt indexPath: IndexPath, point: CGPoint) -> UIContextMenuConfiguration?
- added 2 commits that reference this issue
on Sep 13, 2021 - changed the title
[-]Implement context menus[/-][+]Implement additional context menu APIs[/+]on Apr 1, 2024 - changed the title
[-]Implement additional context menu APIs[/-][+][Delegate] Implement additional context menu APIs[/+]on May 24, 2024 - changed the title
[-][Delegate] Implement additional context menu APIs[/-][+][Delegate] implement additional context menu APIs[/+]on May 24, 2024 @jessesquires saw this from #129, are you happy for me to take this? Assuming we can forward on
CollectionViewModel?@ruddfawcett sure! 😄
Just be aware that I'll be working on some bigger changes next week: #129 (comment)
These three functions do not have an
IndexPathparameter anytime, so we cannot find theSectionViewModelor theCellViewModel.// iOS 13.2+ func collectionView(_ collectionView: UICollectionView, willDisplayContextMenu configuration: UIContextMenuConfiguration, animator: (any UIContextMenuInteractionAnimating)?) // iOS 13.2+ func collectionView(_ collectionView: UICollectionView, willEndContextMenuInteraction configuration: UIContextMenuConfiguration, animator: (any UIContextMenuInteractionAnimating)?) // iOS 13.0+ func collectionView(_ collectionView: UICollectionView, willPerformPreviewActionForMenuWith configuration: UIContextMenuConfiguration, animator: any UIContextMenuInteractionCommitAnimating)
This function uses the
[IndexPath]parameter starting from iOS 16, and multiple sections may be used. Also we cannot find theSectionViewModelor theCellViewModel.// new iOS 16.0+ func collectionView(_ collectionView: UICollectionView, contextMenuConfigurationForItemsAt indexPaths: [IndexPath], point: CGPoint) -> UIContextMenuConfiguration? // old iOS 13.0-16.0 func collectionView(_ collectionView: UICollectionView, contextMenuConfigurationForItemAt indexPath: IndexPath, point: CGPoint) -> UIContextMenuConfiguration?
These two functions did not have an
IndexPathparameter before iOS 16, so we cannot find theSectionViewModelor theCellViewModel.// new iOS 16.0+ func collectionView(_ collectionView: UICollectionView, contextMenuConfiguration configuration: UIContextMenuConfiguration, highlightPreviewForItemAt indexPath: IndexPath) -> UITargetedPreview? // old iOS 13.0-16.0 func collectionView(_ collectionView: UICollectionView, previewForDismissingContextMenuWithConfiguration configuration: UIContextMenuConfiguration) -> UITargetedPreview? // new iOS 16.0+ func collectionView(_ collectionView: UICollectionView, contextMenuConfiguration configuration: UIContextMenuConfiguration, dismissalPreviewForItemAt indexPath: IndexPath) -> UITargetedPreview? // old iOS 13.0-16.0 func collectionView(_ collectionView: UICollectionView, previewForHighlightingContextMenuWithConfiguration configuration: UIContextMenuConfiguration) -> UITargetedPreview?
Docs: https://developer.apple.com/documentation/uikit/uicollectionviewdelegate#3580853
Already implemented
NOT implemented