title: Detect UIScrollview bottom reached
body: <p>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 detect when the bottom of the scrollview is reached:</p>
  
  <p>The code below is implemented in <code>scrollViewDidScroll:</code> delegate</p>
  
  <pre><code>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 &gt; scrollViewBottomOffset){
  
  
      [imagesView addSubview:imagesBottomLoadingView];
  
      [self downloadImages];
  
  }
  </code></pre>
  
  <p>My problem is that when the user scrolls to bottom, my function is called several times, but i want to call it only once. I tried with imagesScrollView.contentOffset.y == scrollViewBottomOffset but it doesn't work and the function is not called</p>