Skip to content

Commit

Permalink
Fix AssetsViewController not scrolling to bottom
Browse files Browse the repository at this point in the history
  • Loading branch information
NSHaoSong committed Apr 15, 2016
1 parent 49b7c6c commit 20c198a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions QBImagePicker/QBAssetsViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,10 @@ - (void)viewWillAppear:(BOOL)animated

// Scroll to bottom
if (self.fetchResult.count > 0 && self.isMovingToParentViewController && !self.disableScrollToBottom) {
NSIndexPath *indexPath = [NSIndexPath indexPathForItem:(self.fetchResult.count - 1) inSection:0];
[self.collectionView scrollToItemAtIndexPath:indexPath atScrollPosition:UICollectionViewScrollPositionTop animated:NO];
dispatch_async(dispatch_get_main_queue(), ^{
NSIndexPath *indexPath = [NSIndexPath indexPathForItem:(self.fetchResult.count - 1) inSection:0];
[self.collectionView scrollToItemAtIndexPath:indexPath atScrollPosition:UICollectionViewScrollPositionTop animated:NO];
});
}
}

Expand Down

0 comments on commit 20c198a

Please sign in to comment.