Merge pull request #1142 from levi/scrollDirectionFix

Add a safety check for targetContentOffset possibly being NULL
This commit is contained in:
appleguy
2016-01-28 15:55:50 -08:00
2 changed files with 5 additions and 5 deletions

View File

@@ -637,8 +637,8 @@ static NSString * const kCellReuseIdentifier = @"_ASCollectionViewCell";
- (void)scrollViewWillEndDragging:(UIScrollView *)scrollView withVelocity:(CGPoint)velocity targetContentOffset:(inout CGPoint *)targetContentOffset
{
_deceleratingVelocity = CGPointMake(
scrollView.contentOffset.x - targetContentOffset->x,
scrollView.contentOffset.y - targetContentOffset->y
scrollView.contentOffset.x - ((targetContentOffset != NULL) ? targetContentOffset->x : 0),
scrollView.contentOffset.y - ((targetContentOffset != NULL) ? targetContentOffset->y : 0)
);
[self handleBatchFetchScrollingToOffset:*targetContentOffset];

View File

@@ -630,10 +630,10 @@ static NSString * const kCellReuseIdentifier = @"_ASTableViewCell";
- (void)scrollViewWillEndDragging:(UIScrollView *)scrollView withVelocity:(CGPoint)velocity targetContentOffset:(inout CGPoint *)targetContentOffset
{
_deceleratingVelocity = CGPointMake(
scrollView.contentOffset.x - targetContentOffset->x,
scrollView.contentOffset.y - targetContentOffset->y
scrollView.contentOffset.x - ((targetContentOffset != NULL) ? targetContentOffset->x : 0),
scrollView.contentOffset.y - ((targetContentOffset != NULL) ? targetContentOffset->y : 0)
);
[self handleBatchFetchScrollingToOffset:*targetContentOffset];
if ([_asyncDelegate respondsToSelector:@selector(scrollViewWillEndDragging:withVelocity:targetContentOffset:)]) {