Reputation: 16793
I have setup scrollView
delegate and implemented the logic into scrollViewDidScroll protocol method as follows, it never goes into the second condition. I wonder what I am missing?
-(void)scrollViewDidScroll: (UIScrollView*)scrollView
{
float scrollViewHeight = scrollView.frame.size.height;
float scrollOffset = scrollView.contentOffset.y;
if (scrollOffset == 0)
{
// then we are at the top
}
else if (scrollOffset + scrollViewHeight == 700.0)
{
// never calls here
[self loadSecondFromURL];
}
}
Upvotes: 1
Views: 68
Reputation: 71
I think scrollOffset is zero so, its entering only first loop. I changed the code like this and it works fine for me
if (scrollOffset == 0)
{
// then we are at the top
}
if (scrollOffset + scrollViewHeight == 700.0)
{
// never calls here
[self loadSecondFromURL];
}
Upvotes: 1