Closed salvasp closed 4 years ago
should be modified also the other metods accordingly like
// delegate?.contextualMenu?(self, didSelectItemAt: menuItem.index)
delegate?.contextualMenu?(self, didSelectItemAt: menuItem.index, sourceAt: startingLocation)
///
guard delegate?.contextualMenuShouldActivate?(self, sourceAt: startingLocation) != false && !contextualMenuItems.isEmpty && shadowView.alpha == 0.0 && window != nil else { return }
In this way you can calculate whether a cell or the background has been touched in the CollectionView and return true / false
OR you can change the menu.startingLocation to be @objc public var
I'm using it for collection views cells and it seems that didSelectItemAt of the collection view is not called because the menu gesture recognizers overrides the touches. So to get the cell indexPath where the menu is shown I have modified:
and
Using it this way
Is it acceptable or is there a better way to use it with collectionViews?