Open KalpeshTalkar opened 8 years ago
Hi there,
The I3DragRenderDelegate
is responsible for rendering drag events. I3GestureCoordinator
delegates everything to do with drawing the snapshot view to I3DragRenderDelegate
, so if you've implemented your own it has to draw the snapshot itself.
One option might be to extend I3BasicRenderDelegate
and override -(void) renderDraggingFromCoordinator:
. That way you can hook into the drag event and allow the base class to do all the rendering. Remember to call the superclass in -(void) renderDraggingFromCoordinator:
.
Here is an example of how to extend I3BasicRenderDelegate
to implement a custom renderer. Take a look at these lines.
Out of interest, why do you want to capture dragging events? The drag renderer is only really meant to be for drawing things on screen. If you want to do some business logic, it might be worth me adding another method to I3DragDataSource
that's called here... what do you think?
Thanks, Steve.
Hi Steve,
So basically I only want the drag events when drag started, while dragging, drag canceled, drag ended. I want the position of the gesture recognizer on the screen while dragging so that I can highlight the tableview on which I hover.
Thanks, Kalpesh
Hi Kalpesh,
Ok. Take a look at this use case. It shows you how to implement a custom renderer that will 'shake' the dragging item when its hovering over one of the tables, which you could easily adapt to highlight the actual table also.
Again, take a look at this implementation of - (void)renderDraggingFromCoordinator:
.
Hope this helps.
Thanks, Steve.
Hi Steve,
Thanks for the guidance.
I wanted to achieve the drag and drop functionality like Trello (https://trello.com/). For Android, I got a library here: https://github.com/woxblom/DragListView The android library is very fluid.
I have created a demo project here: https://github.com/KalpeshTalkar/DragDropBoard The scrolling is not smooth. Please help in enhancing the code if possible.
Thanks, Kalpesh.
To get drag events while dragging, I used I3DragRenderDelegate. But after implementing the delegate, the snapshot view is not rendered. Why do I need to implement all the methods if I implement I3DragRenderDelegate? How will I get a snapshot view?