Reloading table view with negative top content inset causes strange behavior

Originator:skagedal
Number:rdar://37824199 Date Originated:23-Feb-2018 02:47 PM
Status:Open Resolved:
Product:iOS + SDK Product Version:11.2
Classification:Serious Bug Reproducible:Always
 
Summary:
When a table view has a negative top content inset and uses fixed row heights and you do a reloadData, the scroll view gets in a weird state where it rubberbands to an incorrect position. If you pull it “long enough”, it resets to the correct state.

Steps to Reproduce:
- Download included sample project, also available at https://github.com/skagedal/radars
- Run in an iOS 11.2 simulator or on device with Xcode 9.2
- Press “Toggle Preview”
- Press “Cause Problem”

Expected Results:
- Nothing visible happens, table view reloads.

Actual Results:
- Content disappears up above the visible area. If you drag it down, strange stuff happens with cell separators.

Version:
11.2

Notes:
A workaround is to implement estimatedRowHeight and return the same values as rowHeight. This fix is included in the code repo as commented-out code.

Comments

See https://github.com/skagedal/radars for example.


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!