Previously, for invalid batch updates UIKit was silently falling back to reload data previously in some cases, resulting in broken animations in certain cases. This is now a hard exception.
The exception message should have more information on how to solve this problem; essentially your data source counts before and after the update must line up with the updates you submit.
Remember, reloads are decomposed into a delete an an insert.
A simple example here:
Consider a data source with the following section counts:
[10, 20, 30]
If you submit an update with
INSERT(0,0) // section 0, item 0
RELOAD(1,1) // section 1, item 1
INSERT(1, 2) // section 1, item 2
DELETE(2,1) // section 2, item 1
Then your data source counts must move to the updated values inside the performBatchUpdates: block. In the case of the above updates, that means, for the above update,
your data source's implementation of numberOfItemsInSection needs to return
11 for section 0, since one item was inserted
21 for section 1, since one item was inserted and one was reloaded
29 for section 2, since one item was deleted
This can all be tricky to manage, which is why I highly recommend using diffable data source, which will save you the trouble of having to perform this diffing yourself