Conversation
…ns followed by insertions *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Attempt to create two animations for cell
|
Doesn't this cause a different animation to occur? Is this required for all UITableViews? |
|
The animation changes. I think there's a more clean way but I've not yet found it and wonder why the example crashes. For crash safety, I use this patch as a remedy for now. |
|
Hi @banjun ! I was surprised to see your PR. You are everywhere. 🤩 I was wondering if you are convinced that the actual steps in the patch correct? Or is the patch wrong and it is crashing the animation. 🤔 There appear to be some cases where the wrong patch is being generated. See #32 I still need to read the paper to figure out how the algorithm actually works. It would be cool if we could make a UT that repo'ed the problem. [PS: Coming to Tokyo next week for iOSDC. Maybe we can get together and hack out a good solution sometime then. 😀] |
|
@rayfix you, too. 😉 In my case I think the patch is logically correct, but some patch that have moving rows can cause crash in UITableView. (By the way, checking #32, wrong patches may be generated in some case...? 🤔 ) The fact that a logically correct patch can cause crash is noted on other differential change libs, such as RxDataSources & DifferenceKit. They use multi-stage datasource commit to avoid problematic patches. https://github.com/ra1028/DifferenceKit/blob/master/Sources/StagedChangeset.swift#L5 |
I noticed that sometimes UITableView asserts failure when applying diff with moveRows & moveSections.
It's reproducible in the TableViewExample project with some modification to the example data.
So far separating moves into deletions & insertions can resolve this issue, though I have not inspected the diff logic.
This PR includes a patch for UITableView.