I’m using @Jason King 's UITapGestureRecognizer from UIKit. I’m attaching it to an iOSTable using:
declare sub setUserInteractionEnabled lib UIKitLib selector "setUserInteractionEnabled:" (obj_id as ptr, yesNo as Boolean)
setUserInteractionEnabled(Table.Handle, true)
Table.AddGestureRecognizer(TapGestureRecognizer)
I do this so that I can detect taps on various areas of my (custom) table cell and handle those taps in different ways. It all works well except when I put the iOSTable into editing mode. Then the UITapGestureRecognizer intercepts taps on the edit buttons (e.g. Delete button), which are part of the iOSTableDataSource interface, instead of firing the standard iOSTable events.
So I think the best thing for me to do would be to “disconnect” the UITapGestureRecognizer when I put the iOSTable into edit mode. However I can’t work out how to do that. Has anybody got any ideas?
I thought so too, but the RemoveGestureRecognizer method in iOSKit extends iOSView, not iOSTable. So I assumed that must be how it works. I’m not sure how I can use it with iOSTable?
It should work the same for an iOSTable as for an iOSView. Try:
declare sub removeGestureRecognizer lib UIKitLib selector "removeGestureRecognizer:" (viewHandle as ptr, recognizer as ptr)
removeGestureRecognizer(table.Handle, recognizer)