Skip to content

[Delegate] implement additional context menu APIs #1

Description

@jessesquires

Docs: https://developer.apple.com/documentation/uikit/uicollectionviewdelegate#3580853

Already implemented

func collectionView(UICollectionView, contextMenuConfigurationForItemAt: IndexPath, point: CGPoint) -> UIContextMenuConfiguration?

NOT implemented

func collectionView(UICollectionView, previewForDismissingContextMenuWithConfiguration: UIContextMenuConfiguration) -> UITargetedPreview?
func collectionView(UICollectionView, previewForHighlightingContextMenuWithConfiguration: UIContextMenuConfiguration) -> UITargetedPreview?

func collectionView(UICollectionView,  willDisplayContextMenu configuration: UIContextMenuConfiguration,  animator: UIContextMenuInteractionAnimating?)
func collectionView(UICollectionView, willEndContextMenuInteraction configuration: UIContextMenuConfiguration,  animator: UIContextMenuInteractionAnimating?)

func collectionView(UICollectionView, willPerformPreviewActionForMenuWith: UIContextMenuConfiguration, animator: UIContextMenuInteractionCommitAnimating)

Activity

  1. self-assigned this
    on Oct 25, 2019
  2. jessesquires commented on Jan 28, 2020

    @jessesquires
    OwnerAuthor
  3. jessesquires commented on Sep 13, 2021

    @jessesquires
    OwnerAuthor

    currently, only implementing:

    public func collectionView(
    _ collectionView: UICollectionView, 
    contextMenuConfigurationForItemAt 
    indexPath: IndexPath, point: CGPoint) -> UIContextMenuConfiguration?
  4. changed the title [-]Implement context menus[/-] [+]Implement additional context menu APIs[/+] on Apr 1, 2024
  5. removed this from the 0.1.0 Initial Release milestone on Apr 1, 2024
  6. changed the title [-]Implement additional context menu APIs[/-] [+][Delegate] Implement additional context menu APIs[/+] on May 24, 2024
  7. changed the title [-][Delegate] Implement additional context menu APIs[/-] [+][Delegate] implement additional context menu APIs[/+] on May 24, 2024
  8. removed their assignment
    on May 24, 2024
  9. ruddfawcett commented on Oct 4, 2024

    @ruddfawcett
    Collaborator

    @jessesquires saw this from #129, are you happy for me to take this? Assuming we can forward on CollectionViewModel?

  10. jessesquires commented on Oct 4, 2024

    @jessesquires
    OwnerAuthor

    @ruddfawcett sure! 😄

    Just be aware that I'll be working on some bigger changes next week: #129 (comment)

  11. nuomi1 commented on Dec 9, 2024

    @nuomi1
    Collaborator

    These three functions do not have an IndexPath parameter anytime, so we cannot find the SectionViewModel or the CellViewModel.

    // 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 the SectionViewModel or the CellViewModel.

    // 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 IndexPath parameter before iOS 16, so we cannot find the SectionViewModel or the CellViewModel.

    // 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?
  12. nuomi1 commented on Dec 9, 2024

    @nuomi1
    Collaborator
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions