I have two UITableView in my iPad application. I want to drag a cell from one tableview and drop onto another tableview. Please suggest me any idea how can I Implement drag & drop between two tables in iPad ?
Thanks in advance
I've implemented a solution to this before.
gesture coordinator
. It handles the events emitted from a UIGestureRecognizer
to calculate the 'drag and drop' state and notify the delegate. UIGestureRecognizer
.Here are the propositions that I considered when implementing the gesture coordinator:
- A collection is a view that contains and array of child items.
- A drag arena consists of a superview and an ordered set of collections that exist as subviews within that superview.
- The order of the collections in the drag arena determines their drag / drop priority. That is, if a collection sits at the beginning of the drag arena's ordered set of collections, then drags and drops occurring on that collection will be recognized in place of any of the later collections in the set.
- A drag starts if and only if a gesture is started within the bounds of a draggable item of a collection in the drag arena. Dragging occurs if and only if, immediately after a drag has been started, the location of the gesture changes within the drag arena.
- A drag stops if and only if immediately after dragging the gesture stops, is cancelled or finishes.
- A deletion occurs if and only if the drag stops at a point which is specified as being deletable. For example, the user may designate certain bounds within the drag arena to be 'delete on drop' areas.
- A rearrange occurs if and only if the drag stops within the bounds of the collection that it started in, on a different item in that collection which is specified as being rearrangeable, and on a point in the drag arena that is not specified as being deletable.
- A drop occurs if and only if the drag stops within the bounds of another collection in the drag arena, on a specific item or point that is specified as droppable within that collection, and on a point in the drag arena which is not specified as being deletable.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With