Is there a way to adjust time which takes for drag to begin on collection view cell? Similar to UILongPressGestureRecognizer
minimumPressDuration
property.
I know we can iterate over all gesture recognizers attached to the view and probably find the one we need. But this approach doesn't feel reliable.
Since there's no better solution, i still used 'iterate over gesture recognizers' approach.
Code is the following:
Constants.DragLongPressMinimumDuration
isDouble
defined inConstants
struct.Important note: do this on collection view itself (and not cells) after setting up drag and drop.
Solution works ok for iOS versions 11 and 12.
Of course this is on the edge of using private API, actual class of that recognizer is
_UIDragLiftGestureRecognizer
(which is part of private API, andUILongPressGestureRecognizer
subclass). But since we're casting it toUILongPressGestureRecognizer
, technically we're not using private API.