UICollectionView should provide a way to derive the visible bounds from a containing scroll view

Originator:steipete
Number:rdar://33316335 Date Originated:14-Jul-2017 05:04 PM
Status:Open Resolved:
Product:iOS + SDK Product Version:11b3
Classification:Enhancement Reproducible:Always
 
Summary:
UICollectionView offers a great way to build all sorts of custom layouts while at the same time being very memory and performance efficient by only loading the cells that are actually visible on screen.

There is one scenario where all this awesomeness goes south, though: When you need to embed a collection view in a scroll view (e.g. to be able to zoom a collection view) the collection view always loads all cells because its size is equal to the containing scroll view’s content size.

There should be support for this kind of scenario from UIKit.


Steps to Reproduce:
0. Open the attached sample
1. Check out ViewController

Expected Results:
The locations marked with FIXME should work the way I noted it there.

Actual Results:
There is a quite ugly work around required to get it working which has the caveat to break flow layout as well as cell prefetching.

Version:
11b3

Notes:
This is a duplicate of radar #33316167. We also know that Apple needs and uses this internal and found SPI for it. Please make this available in iOS 11.

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!