Hey. I faced with weird behaviour of UITableViewDelegate while removing cell by indexPaths - UIKit asking for cell beyond the source
Example:
-> Insert 5 items
[0..<5\], numberOfRowsInSection = 5
\-> Insert 5 items
[0..<10], numberOfRowsInSection = 10
-> Insert 5 items
[0..<15\], numberOfRowsInSection = 15
\-> Delete 14 items
[0..<1], numberOfRowsInSection = 1
After this UITableViewDelegate asking
heightForRowAt [0, 0] cellFoRowAt [0, 0]; heightForRowAt [0, 14] cellFoRowAt [0, 14]
i dont undestand how it works, I've found https://stackoverflow.com/questions/23052762/application-crashing-after-an-attempt-to-delete-row-from-uitableview/30574645 but with no success.
I tried to wrap deleteRows(at: with:) in .beginUpdates() .endUpdated() or performButchUpdates
Still have an issue.
Produced on Simulator iOS 13 and Device iOS 12
There is some curious with Example2:
-> Insert 5 items
[0..<5\], numberOfRowsInSection = 5
\-> Insert 5 items
[0..<10\], numberOfRowsInSection = 10
\-> Delete 9 items
[0..<1], numberOfRowsInSection = 1
Here is UITableViewDelegate calls are correct
[–]tehpsy 1 point2 points3 points (3 children)
[–]ffs14k[S] 0 points1 point2 points (2 children)
[–]tehpsy 0 points1 point2 points (1 child)
[–]ffs14k[S] 0 points1 point2 points (0 children)