mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2026-02-15 07:19:57 +00:00
Merge pull request #1142 from levi/scrollDirectionFix
Add a safety check for targetContentOffset possibly being NULL
This commit is contained in:
@@ -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];
|
||||
|
||||
@@ -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:)]) {
|
||||
|
||||
Reference in New Issue
Block a user