You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Great library, perfect drop in functionality for what I need. This is more of a feature request. I have some dynamic content - the cell number - that I'd like to have update as the cell is dragged around. Other use-cases could be imagined (background colour in an alternately-striped table etc). I'd like a method I could call from the delegate as the cell moves. I'm already reloading data in the delegate's reorderRowAt... method but this doesn't regenerate the UIImage snapshot used in dragging. A naive fix for this is to make createSnapshotViewForCell() public and call that, but I suspect that there are situations where something this simple will break. Happy to look at contributing a PR if you can suggest your preferred extension point for this. Thanks.
The text was updated successfully, but these errors were encountered:
Currently, the snapshot view has to be generated at the beginning of the drag-and-drop interaction. This is because the target cell isn't actually present in the tableview while the user's dragging; it's replaced with a blank 'spacer cell'. So I'm not sure if there's a simple way to accomplish what you're looking for.
Maybe you could create your own snapshot view with the same view hierarchy as the table cell, keep a reference to it in your view controller, and update it that way? You could add another TableViewReorderDelegate method, and have the reorder controller check if you're providing a custom snapshot view before it generates a UIImage snapshot. Or something like that.
If you do figure anything out, let me know. I'd welcome any contributions or improvements. The library could use a bit of work -- there's some lingering iOS 11 issues still. I've thought about a more comprehensive rewrite that relies less on UIKit behaviors... Just a matter of finding the time.
Great library, perfect drop in functionality for what I need. This is more of a feature request. I have some dynamic content - the cell number - that I'd like to have update as the cell is dragged around. Other use-cases could be imagined (background colour in an alternately-striped table etc). I'd like a method I could call from the delegate as the cell moves. I'm already reloading data in the delegate's
reorderRowAt...
method but this doesn't regenerate the UIImage snapshot used in dragging. A naive fix for this is to makecreateSnapshotViewForCell()
public and call that, but I suspect that there are situations where something this simple will break. Happy to look at contributing a PR if you can suggest your preferred extension point for this. Thanks.The text was updated successfully, but these errors were encountered: