I have custom backgrounds (one for first rows, other for middle rows and other for last rows). When I delete a row of the tableView (swipe to delete), if I delete the first row, the new first row that was a middle row before that, stills remains with the middle background.
I tried to reloadData and it works but it kills the nice fade animation when deleting.
How can I update the style without killing the smooth animation?
Thanks in advance!
You could use
reloadRowsAtIndexPaths:withRowAnimation:(Create an array with the index path of the table row(s) to be updated). When inbetween a call tobeginUpdatesandendUpdatesyou can use this to create a smooth animation. (all methods to be called on UITableView)Note that these functions do have an understanding of “before” and “after” the update and can check if section and row counts are appropriate (especially important when also inserting and deleting between beginUpdates and endUpdates.