This is a solution that is a re-working of a post by Scott Sherwood which can be found here.

I hope that I have simplified the process involved in providing a complete Swift class that you can implement in your project. I have also added the ability to determine which cell an object was dropped onto, allowing for a 're-ordering' functionality.

So how do you use this in conjunction with an NSFetchedResultsController? Whichever class has the capability to modify the CoreData records that make up your tableViews should implement the DragDropControllerDelegate protocol and implement the methods below.

To make sure that the effect of a drag/drop action is visible, you should make sure that you have implemented the appropriate NSFetchedResultsControllerDelegate methods. Alternatively, just call yourTable.reloadTable() at the end of the 'droppedon' function.

I'm utilizing my CoreDataConduit class from this blog post so make sure it's included in your project.

The 'droppedon' delegate method is the action that is taken once the drag is finished and the object is dropped. The first stage in my implementation above is checking whether content has been passed to the function that is either an object ID (allowing me to retrieve the CoreData object) or a reference to the CoreData object itself. If it's neither of these - then I attempt to pull the CoreData object from the fetched results controller itself.

The next stage is getting the 'order'. I have assumed in this example that your CoreData object model includes a double called 'order' which determines the viewing order of each row in the table. The order is made to be just after the cell onto which the object was dropped, or the very end of the series if the object was dropped onto the empty space within the tableview.

The last stage is modifying the CoreData object. In this example, I have only changed the order, but you can include other changes here as well.

Please drop a comment if you are having any trouble and I'll do my best to help you out!