UITableView row deletion animation issue when used in combination with tableHeaderView

Originator:s.h.meadley
Number:rdar://49974619 Date Originated:17/04/2019
Status:Open Resolved:
Product:iOS Product Version:12.2
Classification:UIKit Reproducible:Always
 
Summary:
There is a deletion animation issue when invoking `deleteRows(at:with:)` in combination with a `tableHeaderView`. 

When the header is about to come in to view, the table view content jumps up on delete (appears to be the height of one of the cells) before animating away.

See attached video. This is particularly easy to observe with slow-motion animations.

Steps to Reproduce:
1. Add table view 
2. Set fixed height tableHeaderView
3. Add a number of cells to the table view, enough for the header to be off the screen when scrolled to the bottom.
4. Delete the cells from the bottom of the table view. When the header is about to become visible the deletion animation is broken. 

Reproduction steps in the attached sample application: 
1. Run the attached project on iPhone XS (or iPhone XS simulator)
2. Scroll to bottom of table view
3. Tap to remove cells 10 and 9- animation work as expected.
4. Tap row 8 - the table view content visibly jumps up before animating away the cell.

Expected Results:
The table view content should not jump before animating.

Actual Results:
The table view content jumps up what appears to be the height of one cell before animating the row away.

Version/Build:
iOS 12.2 (16E227)

Configuration:
iPhone XS

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!