Search code examples
objective-cioscocoa-touchuigesturerecognizeraqgridview

AQGridView long press grid cell detection


I want to detect if a AQGridCellView is pressed long and instead of selecting it I want to show a menu with custom options. I thought just adding a long press gesture recognizer to a subclass of the cell view will be enough to handle that, but looks like the AQGridView already catches all interactions with the cells.

Does anybody know how to workaround that and recognize a long press on the grid cell?


Solution

  • I got in touch with the developer of the library and found out that this isn't possible with the library itself. But I found a simple workaround to that:

    1. Disable selections in the AQGridView.
    2. Create a custom grid cell and add a UITapGestureRecognizer and a UILongGestureRecognizer.
    3. Instead of reacting to the AQGridViewDelegate attach to the selectors of the gesture recognizers.

    This works fine for my application. Hope this solution will help somebody else too.