I'm trying to drag & drop a customCell from a tableView. I'm using an UIImageView that gets the image of the customCell and then drag it around the view but the problem is that I can't get the image of the customCell.
CustomCellClass *customCell = [[CustomCellClass alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:[CustomCellClass identifier]];
customCell.textLabel.text = "Dragging cell";
_draggedImageView.image = customCell.imageRepresentation;
But this doesn't work, it doesn't get any image.
I also tried:
CustomCellClass *customCell = [tableView dequeueReusableCellWithIdentifier:[CustomCellClass identifier] forIndexPath:0];
customCell.textLabel.text = "Dragging cell";
_draggedImageView.image = customCell.imageRepresentation;
This works but there's a problem. Since I'm changing the text of the reused customCell it'll change in the tableView too. I need a copy of the customCell so I can have the correct layout, change what I want in that copy (in this case the textLabel of the cell) and add it the imageView to drag, and this separated from any customCell of the tableView.
Any ideas how to achieve this?
Thank you all.