 
       if let viewController = viewController as? UIViewController {
         if let image = viewController.screenshotFromWindow(scale: SAHistoryNavigationViewController.kImageScale) {
-          screenshotImages += [image]
+          screenshots += [ScreenShot(image: image, navigationItem: viewController.navigationItem)]
         }
       }
     }


  override public func pushViewController(viewController: UIViewController, animated: Bool) {
    if let image = visibleViewController.screenshotFromWindow(scale: SAHistoryNavigationViewController.kImageScale) {
      screenshotImages += [image]
    }
    super.pushViewController(viewController, animated: animated)
  }

  override public func popToRootViewControllerAnimated(animated: Bool) -> [AnyObject]? {
    screenshotImages.removeAll(keepCapacity: false)
    return super.popToRootViewControllerAnimated(animated)
  }

  override public func popToViewController(viewController: UIViewController, animated: Bool) -> [AnyObject]? {
    if let vcs = viewControllers as? [UIViewController],
      let index = find(vcs, viewController) {
        screenshotImages.removeRange(index..<screenshotImages.count)
    }
    return super.popToViewController(viewController, animated: animated)
  }


extension SAHistoryNavigationViewController: UINavigationBarDelegate {
  public func navigationBar(navigationBar: UINavigationBar, didPopItem item: UINavigationItem) {
    screenshots = screenshots.filter { screenshot in
      return screenshot.navigationItem != item
    }
  }
}

