Make SPI to hook into UIScrollView didScroll public

Originator:michaelhochs
Number:rdar://33675992 Date Originated:02-Aug-2017 03:56 PM
Status:Open Resolved:
Product:iOS + SDK Product Version:11b4
Classification:Enhancement Reproducible:Always
 
Summary:
UIScrollView has a nice SPI that lets other objects hook into didScroll to be able to update things based on a scroll event. This is a very helpful API and as of iOS 11 it looks like this SPI has even be more improved and it looks like this now is a nice block based registration pattern.

Making this publicly available would be great for apps and frameworks alike.

Steps to Reproduce:
 

Expected Results:
 

Actual Results:
 

Version:
11b4

Notes:
While this can be implemented on client side pretty easily with a subclass to UIScrollView the benefit of having this publicly available on UIScrollView would be that all subclasses inherit this automatically. So on client side you wouldn’t need to build a subclass for UIScrollView, UICollectionView and other scroll view derived classes just to achieve this behavior. Furthermore when developing a framework, you might not know what you are dealing with, so e.g. looking up the view hierarchy for a scroll view and hooking into this currently is not possible in this cases simply because the component in question might not own the view in question.

A very great use case for this is also what UICollectionView does with its private `shouldDeriveVisibleBoundsFromContainingScrollView` logic. Being able to implement something like this on your own views would be very helpful.

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!