UICollectionView sticky header (sectionHeadersPinToVisibleBounds) disappears for while after inserting section when collection is overscrolled (bounce effect)

Originator:jm.jakubmarek
Number:rdar://48363057 Date Originated:February 25 2019
Status:Open Resolved:
Product:iOS + SDK Product Version:iOS 11.x and 12.x
Classification: Reproducible:Always
 
Area:
UIKit

Summary:
========
`UICollectionView` with 
    - `UICollectionViewCell` cells
    - `UICollectionReusableView` section headers
    - `UICollectionViewFlowLayout` collections's layout
    - `sectionHeadersPinToVisibleBounds ` is enabled

If the insertion (`insertItemsAtIndexPaths` inside `performBatchUpdates` block) happens when collection is overscrolled (bounce is enabled), header will disappear for while. See attached video.


Steps to Reproduce:
===============
Start the attached example project and scroll to the bottom quickly and keep collection overscrolled (keep it bouncing - as you can see in the attached video).


Expected Results:
=============
Header will be unchanged after section insertion (sticky). See attached "Expected look" image.


Actual Results:
===========
Header disappears when insertion becomes during collection overscroll at the bottom (bounce effect). See attached "Look after section insertion with overscrolled collection" image.


Version/Build:
==========
iPhone 7 with iOS 12.1.4 or any simulator with iOS 11.x and 12.x


Configuration:
==========
iPhone 7 with iOS 12.1.4 or any simulator with iOS 11.x and 12.x

Comments

Example project, video and images showing described issue:
https://github.com/jmarek41/Collection-sticky-headers

By jm.jakubmarek at Feb. 26, 2019, 9:37 a.m. (reply...)

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!