I have a table with shadows above the upper and lower cells (using Matt Gallagher's solution here: http://cocoawithlove.com/2009/08/adding-shadow-effects-to-uitableview.html ). They are added in the layoutSubviews method of the extension of the UITableView class.
I dynamically add and remove cells under each main cell (they provide additional data) - let me call these "detailed" cells. Only one opens at a time. When you delete the "detail cell" under the last main cell, when the animation starts, the shadow moves up to the last cell (above the part cell). This is because layoutSubview methods believe that the last table cell has changed since the start of the animation for deleteRowsAtIndexPaths (and not after the end of the animation).
So, essentially, I need a way to keep the shadow under the part cell, since its removal. Not sure of the best way to do this. If the UITableView no longer considers this cell to be the last cell, then I'm not even sure how to get the cell (since the UITableView gets the cell this way):
NSIndexPath *lastRow = [indexPathsForVisibleRows lastObject];
if ([lastRow section] == [self numberOfSections] - 1 &&
[lastRow row] == [self numberOfRowsInSection:[lastRow section]] - 1)
{
}
, , UITableView - , "detail" "lastObject".
.