Add scroll to page helper to ASPagerNode

This commit is contained in:
Levi McCallum
2015-12-21 09:07:48 -06:00
parent ad4db73b95
commit 10030dfe70
2 changed files with 10 additions and 0 deletions

View File

@@ -49,6 +49,14 @@
[self setTuningParameters:renderParams forRangeType:ASLayoutRangeTypeRender];
}
#pragma mark - Helpers
- (void)scrollToPageAtIndex:(NSInteger)index animated:(BOOL)animated
{
NSIndexPath *indexPath = [NSIndexPath indexPathForItem:index inSection:0];
[self.view scrollToItemAtIndexPath:indexPath atScrollPosition:UICollectionViewScrollPositionLeft animated:animated];
}
#pragma mark - ASCollectionViewDataSource
- (ASCellNode *)collectionView:(ASCollectionView *)collectionView nodeForItemAtIndexPath:(NSIndexPath *)indexPath