UIScrollView.isTracking cannot be observed with NSKeyValueObservation

Originator:kylebshr
Number:rdar://47799272 Date Originated:2/4/2019
Status:Open Resolved:
Product:UIKit Product Version:Xcode 10.1 (10B61)
Classification:Other Bug Reproducible:Yes
 
Summary:
Observing UIScrollView.isTracking using NSKeyValueObservation does not work. The closure is not called when the value changes, unlike other properties such as isHidden. See the attached project for an example.

Steps to Reproduce:
Implement the following in a project with a scroll view: 

self.trackingObservation = scrollView.observe(\.isTracking) { [weak self] scrollView, _ in
    print(scrollView.isTracking)
}

Expected Results:
When the scroll view isTracking property changes, the observation closure should be called. 

Actual Results:
The observation closure is not called when the isTracking property changes. 

Version/Build:
Xcode 10.1 (10B61)
iOS Simulator 12.1 (16B91)
iOS 12.1.3 on iPhone 7

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!