       UIGraphicsEndImageContext()
       return image
     }
-
     return nil
   }
 }

      if let viewController = destinationViewController {
        popToViewController(viewController, animated: false)
      }


      UIView.animateWithDuration(0.25, delay: 0.0, options: .CurveEaseOut, animations: {
        self.historyViewController.view.transform = CGAffineTransformIdentity


extension UIViewController {
  func screenshotFromWindow(scale: CGFloat = 0.0) -> UIImage? {
    if let window = UIApplication.sharedApplication().windows.first as? UIWindow {
      UIGraphicsBeginImageContextWithOptions(window.frame.size, false, scale)
      window.drawViewHierarchyInRect(window.bounds, afterScreenUpdates: true)
