my question is, wether or not this is possible, and if so, how would you approach this task?
Does anybody know of an app already using this functionality, or where to get some sample code?
Also, if i’m to implement this on my own without too much knowledge of the topic what would be your estimation on how long it would take to get it done?
One other thing to mention, since it could make things more complicated: The destination table is in editmode per default, so that the user can rearrange the cells (using the standard reordering control in accessory view), which have already been dropped there.
Edit:
I just tried to include a screenshot of a concept image in my post. The image shows one table on the left and a grayish drop area on the right. My customer says that he saw this on other apps, too, so there has to be some kind of ui element that I am not aware of.
I haven’t found anything in the developer library about such a drop area, so hopefully one of you can give me directions or clear things up.
Ok, I managed to implement this myself and I’m quite happy with the result. You can drag cells from left (source table) to right (destination table) and also drag cells within the destination table for reodering. If you try to drag a cell from right to left it will be reinserted at the same position where you started dragging (so nothing happens). The destination table also supports deletion of cells, the source table doesn’t. So here’s the complete code:
UIDropTableViewController.h
UIDropTableViewController.m
Here is an example of how to use it:
Then, after you are done editing you just read
dropTable.dstDataand continue using it for what ever you want to do.In
UIDropTableViewController.myou might want to adjustinitDraggedCellWithCell,srcTableCellForRowAtIndexPathanddstTableCellForRowAtIndexPathfor your own needs as far as cell representation goes.