pull-to-refresh
pull-to-refresh copied to clipboard
Fixed observer race condition
Background
- In some edge cases we are observing issues with properly removing the observer because of reliance on
superviewandisObservingScrollViewresulting in observed values getting emitted with no message handler. This ultimately results in a crash.
Changes
- Instead of relying on
superviewto remove the observer we can set theobserverourselves when it gets created. This eliminates the need to check if its of typeUIScrollViewand also eliminates the need forisObservingScrollViewsince we can use the class-levelobserverto check if one is set before removing it