|
@@ -128,21 +128,24 @@
|
|
|
|
|
|
[self.collectionView reloadData];
|
|
|
|
|
|
- NSIndexPath *indexPath = [NSIndexPath indexPathForItem:self.pdfView.currentPageIndex inSection:0];
|
|
|
- [self.collectionView selectItemAtIndexPath:indexPath
|
|
|
- animated:NO
|
|
|
- scrollPosition:UICollectionViewScrollPositionCenteredVertically];
|
|
|
+ if(self.pdfView.document) {
|
|
|
+ NSIndexPath *indexPath = [NSIndexPath indexPathForItem:self.pdfView.currentPageIndex inSection:0];
|
|
|
+ [self.collectionView selectItemAtIndexPath:indexPath
|
|
|
+ animated:NO
|
|
|
+ scrollPosition:UICollectionViewScrollPositionCenteredVertically];
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
|
|
|
- (void)viewDidAppear:(BOOL)animated {
|
|
|
[super viewDidAppear:animated];
|
|
|
|
|
|
- NSIndexPath *indexPath = [NSIndexPath indexPathForItem:self.pdfView.currentPageIndex inSection:0];
|
|
|
- [self.collectionView scrollToItemAtIndexPath:indexPath
|
|
|
- atScrollPosition:UICollectionViewScrollPositionCenteredVertically
|
|
|
- animated:NO];
|
|
|
-
|
|
|
+ if(self.pdfView.document) {
|
|
|
+ NSIndexPath *indexPath = [NSIndexPath indexPathForItem:self.pdfView.currentPageIndex inSection:0];
|
|
|
+ [self.collectionView scrollToItemAtIndexPath:indexPath
|
|
|
+ atScrollPosition:UICollectionViewScrollPositionCenteredVertically
|
|
|
+ animated:NO];
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
#pragma mark - Class method
|