title: Update Navigation bar
body: <p>All i m trying to do is to update navigation bar when user turns page over. Below is my code</p>
  
  <pre><code>- (UIViewController *)pageViewController:(UIPageViewController *)pageViewController 
    viewControllerBeforeViewController:(UIViewController *)viewController {
  
  contentViewController = [[ContentViewController alloc] initWithPDF:PDFDocument];
  
  currentIndex = [modelArray indexOfObject:[(ContentViewController *)viewController page]];
  
  if (currentIndex == 0) {
  
      return nil; 
  }
  
  contentViewController.page = [modelArray objectAtIndex:currentIndex - 1];
  
   [self updateNavigationBar];
  
  return contentViewController;
  
  }
  
  - (UIViewController *)pageViewController:(UIPageViewController *)pageViewController
     viewControllerAfterViewController:(UIViewController *)viewController {
  
  contentViewController = [[ContentViewController alloc] initWithPDF:PDFDocument];
  
  //get the current page
  currentIndex = [modelArray indexOfObject:[(ContentViewController *)viewController page]];
  
  if (currentIndex == totalPages - 1) {
  
      return nil;
  }
  
  contentViewController.page = [modelArray objectAtIndex:currentIndex + 1];
  
   [self updateNavigationBar];
  
  return contentViewController;
  
  }
  
  -(void) updateNavigationBar{
  
  if (CGPDFDocumentGetNumberOfPages(PDFDocument) &gt; 1) {
      title = [NSString stringWithFormat:@"Page %u of %u", currentIndex - 1, CGPDFDocumentGetNumberOfPages(PDFDocument)];
  } else if ((CGPDFDocumentGetNumberOfPages(PDFDocument) &lt; 1) {
  
  
   title = [NSString stringWithFormat:@"Page %u of %u", currentIndex + 1, CGPDFDocumentGetNumberOfPages(PDFDocument)];
  
  }
  </code></pre>
  
  <p>But seems like it is not working at all i m able to turn page over but not able to update navigation bar.</p>
  
  <p>and this is the code for navigation bar</p>
  
  <pre><code>_navBar = [[UINavigationBar alloc] initWithFrame:CGRectMake(0, 0, self.view.bounds.size.width, 45)];
  
  _navBar.tintColor = [UIColor colorWithRed:243.0/255.0 green:164.0/255.0 blue:0.0/255.0 alpha:1.0];
  
  title = [[UINavigationItem alloc] initWithTitle:[NSString stringWithFormat:
                                                                     @"Page %u of %u",
                                                                     currentIndex,
                                                                    CGPDFDocumentGetNumberOfPages(PDFDocument)]];
   [_navBar pushNavigationItem:title animated:NO];
  </code></pre>
  
  <p>Please help.</p>
  
  <p>Appreciate it.</p>
  
  <p>Thanks.</p>