Problem having is that it start updating current page number after you turn 3 or 4 pages over then it start updating current page number starting from 1, 2, 3, 4,..... which is wrong. and if you start in reverse order turning page over lets suppose from 12 then it shows 13 and then from next page it starts updating current pagenumber in reverse order.
- (void)pageViewController:(UIPageViewController *)pageViewController didFinishAnimating:(BOOL)finished previousViewControllers:(NSArray *)previousViewControllers transitionCompleted:(BOOL)completed{
if (!completed) {
return;
}
if (currentIndex<totalPages -1 ){
[self displaycurrentIndex:currentIndex + 1];
}else if (currentIndex>totalPages + 1){
[self displaycurrentIndex:currentIndex - 1];
}
}
- (void) displaycurrentIndex:(NSUInteger)currentIndex {
self.navigationItem.title = [NSString stringWithFormat:
@"Page %i of %i",
currentIndex + 1,
CGPDFDocumentGetNumberOfPages(PDFDocument)];
}
Please help in how to fix this updating current page number from the beginning and also when going in reverse order.
Edit:
After removing
if (!completed) {
return;
}
Now it is Updating after turning first page over but now updates current page number from 0 of 20 and then 1 of 20 and so on but still when turning page over in reverse order it still updates current pagenumber in forward and then in reverse order.
Thanks for help.