Skip to content

Instantly share code, notes, and snippets.

@blixt
Created January 26, 2015 22:11
Show Gist options
  • Select an option

  • Save blixt/81abe1ee4c2db1de482f to your computer and use it in GitHub Desktop.

Select an option

Save blixt/81abe1ee4c2db1de482f to your computer and use it in GitHub Desktop.
- (void)scrollViewWillEndDragging:(UIScrollView *)scrollView withVelocity:(CGPoint)velocity targetContentOffset:(inout CGPoint *)targetContentOffset {
if (scrollView.contentOffset.x < -scrollView.contentInset.left) {
targetContentOffset->x = -scrollView.contentInset.left;
} else {
*targetContentOffset = CGPointZero;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment