Skip to content

How to make cell background clear when using context menu? #1656

Locked Answered by ElrB
ElrB asked this question in Q&A
Discussion options

You must be logged in to vote

For those who would like a solution in the future, here:

NOTE: in your context menu configuration set identifier as so:
let config = UIContextMenuConfiguration(identifier: indexPath as NSCopying, previewProvider: nil)

func collectionView(_ collectionView: UICollectionView, previewForHighlightingContextMenuWithConfiguration configuration: UIContextMenuConfiguration) -> UITargetedPreview? {
   return makeTargetedPreview(for: configuration)
}
    
func collectionView(_ collectionView: UICollectionView, previewForDismissingContextMenuWithConfiguration configuration: UIContextMenuConfiguration) -> UITargetedPreview? {
   return makeTargetedPreview(for: configuration)
}
    
private func makeTa…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Kaspik
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
1 participant
Converted from issue

This discussion was converted from issue #1652 on December 14, 2021 12:12.