Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue while scrolling below 0 offset of scroll view #53

Open
kanwarpal opened this issue Dec 19, 2013 · 0 comments
Open

Issue while scrolling below 0 offset of scroll view #53

kanwarpal opened this issue Dec 19, 2013 · 0 comments

Comments

@kanwarpal
Copy link

Hi,

I have faced an issue in scrolling images when we scroll very fast and scroll view offset becomes -ve, i that case app will crash

Can you please check the code?

I have fixed that in below method
by adding

if(_scroller.contentOffset.x < 0)
return;

  • (void)scrollingHasEnded {

    _isScrolling = NO;
    if(_scroller.contentOffset.x < 0)
    return;
    NSUInteger newIndex = floor( _scroller.contentOffset.x / _scroller.frame.size.width );

    // don't proceed if the user has been scrolling, but didn't really go anywhere.
    if( newIndex == _currentIndex )
    return;

    // clear previous
    [self unloadFullsizeImageWithIndex:_currentIndex];

    _currentIndex = newIndex;
    [self updateCaption];
    [self updateTitle];
    [self updateButtons];
    [self loadFullsizeImageWithIndex:_currentIndex];
    [self preloadThumbnailImages];
    }

If its fine then please update the code so that in future if anyone use this then should not face this issue.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant