I have a UIScrollView with images, and when the user scrolls to the end of the scrollview, I want to update the content. This is my code to determine when the bottom of the scroll is reached:
The code below is implemented in scrollViewDidScroll: delegate
CGFloat scrollViewHeight = imagesScrollView.bounds.size.height; CGFloat scrollContentSizeHeight = imagesScrollView.contentSize.height; CGFloat bottomInset = imagesScrollView.contentInset.bottom; CGFloat scrollViewBottomOffset = scrollContentSizeHeight + bottomInset - scrollViewHeight; if(imagesScrollView.contentOffset.y > scrollViewBottomOffset){ [imagesView addSubview:imagesBottomLoadingView]; [self downloadImages]; }
My problem is that when the user scrolls down, my function is called several times, but I want to call it only once. I tried with imagesScrollView.contentOffset.y == scrollViewBottomOffset, but it does not work and the function is not called
ios uiscrollview
lubilis
source share