Z-index of decoration view is ignored

Originator:forester.john
Number:rdar://30118987 Date Originated:01/20/17
Status:Open Resolved:
Product:UIKit Product Version:
Classification: Reproducible:Always
 
Frequently after calling "reloadSections:" on a UICollectionView, decoration views will then appear with a different z-index. This often causes the decoration views to appear on top of collection view items that have higher z-indexes.

I have attempted to reset the z-index on "initialLayoutAttributesForAppearingDecorationElementOfKind:atIndexPath:" and "finalLayoutAttributesForDisappearingDecorationElementOfKind:atIndexPath:" but this has not resolved the issue.

I have prepared a sample app that demonstrates the issue.

Steps to Reproduce:
1.) On a UICollectionView with a custom subclass of UICollectionViewFlowLayout, add a decoration view to a  that has a lower z-index than the items and/or supplementary views. 
2.) Call "reloadSections:" on the UICollectionView (might take 2-4 calls to reproduce.

In the provided sample project:

Click "reload section" 2-4 times to reproduce issue.

Expected Results:
Z-index of decoration view is respected in relation to other elements in the collection view.

Actual Results:
Z-index of decoration view is not respected. respected in relation to other elements in the collection view.

Version:
iOS 10+

Comments

I'm experiencing the same issue.

By dima.kalachov at Feb. 22, 2017, 8:17 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!