Fix fetch call won't occur for content smaller than bounds unless user scrolls

This commit is contained in:
Michael Schneider
2016-04-04 20:51:24 -07:00
parent 0fbc77dd25
commit c25a252e1c
7 changed files with 160 additions and 53 deletions

View File

@@ -20,7 +20,7 @@ BOOL ASDisplayShouldFetchBatchForContext(ASBatchContext *context,
}
// only Down and Right scrolls are currently supported (tail loading)
if (scrollDirection != ASScrollDirectionDown && scrollDirection != ASScrollDirectionRight) {
if (!ASScrollDirectionContainsDown(scrollDirection) && !ASScrollDirectionContainsRight(scrollDirection)) {
return NO;
}
@@ -31,11 +31,11 @@ BOOL ASDisplayShouldFetchBatchForContext(ASBatchContext *context,
CGFloat viewLength, offset, contentLength;
if (scrollDirection == ASScrollDirectionDown) {
if (ASScrollDirectionContainsDown(scrollDirection)) {
viewLength = bounds.size.height;
offset = targetOffset.y;
contentLength = contentSize.height;
} else { // horizontal
} else { // horizontal / right
viewLength = bounds.size.width;
offset = targetOffset.x;
contentLength = contentSize.width;