ole / OLEContainerScrollView

A UIScrollView subclass that intelligently handles multiple child scroll views and does not interfere with UIKitʼs cell reuse functionality.
http://oleb.net/blog/2014/05/scrollviews-inside-scrollviews/
MIT License
587 stars 67 forks source link

call super last to ensure KVO observations are removed before deallocation #18

Closed JimRoepcke closed 6 years ago

JimRoepcke commented 6 years ago

We had a crash where iOS 9/10 devices were crashing because OLEContainerScrollView was still observing KVO properties on a subview as it was being deallocated, causing an exception to be raised in NSKVODeallocate.

Calling willRemoveSubviewFromContainer: before [super willRemoveSubview:subview] gives the OLEContainerScrollView an opportunity to deregister itself before it's too late.

ole commented 6 years ago

@JimRoepcke Thanks a lot!