I just use the PullToRefresh and InfiniteScrolling just like normal in code. But in one of my view controller the Xcode tell me the observer not remove when the scrollview dealloc. It not crash but may make a leak. And all other view controller is working so good. It's weird.
But I finally find the issue.:tada::tada::tada:
When I set the
showsInfiniteScrolling = YES or showsPullToRefresh = YES
before
addPullToRefreshWithActionHandler or addInfiniteScrollingWithActionHandler
the scrollview will add observer twice and only remove once when it dealloc.
Because the condition in setShowsPullToRefreshandsetShowsInfiniteScrolling is like this
if (!self.pullToRefreshView.isObserving) {if (!self.infiniteScrollingView.isObserving) {
Before you set the handler the pullToRefreshViewandinfiniteScrollingView is nil so the code run inside.
I just use the PullToRefresh and InfiniteScrolling just like normal in code. But in one of my view controller the Xcode tell me the observer not remove when the scrollview dealloc. It not crash but may make a leak. And all other view controller is working so good. It's weird.
But I finally find the issue.:tada::tada::tada: When I set the
showsInfiniteScrolling = YES
orshowsPullToRefresh = YES
beforeaddPullToRefreshWithActionHandler
oraddInfiniteScrollingWithActionHandler
the scrollview will add observer twice and only remove once when it dealloc.Because the condition in
setShowsPullToRefresh
andsetShowsInfiniteScrolling
is like thisif (!self.pullToRefreshView.isObserving) {
if (!self.infiniteScrollingView.isObserving) {
Before you set the handler thepullToRefreshView
andinfiniteScrollingView
is nil so the code run inside.I already fix it and pull a request: https://github.com/samvermette/SVPullToRefresh/pull/221