         }
     }
     
+    private var backgroundTransitionOriginalState: (size: CGSize, snapshots: [UIView?]?)?
+    
     override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) {
+        
+        // When iPad applications enter the background, they take a snapshot, rotate, take another snapshot, and rotate back.
+        // For this very specific use case, we'll save the original snapshots so we can reuse them when we get back to the original state.
+        if UIApplication.shared.applicationState == .background {
+            
+            if let originalState = backgroundTransitionOriginalState, originalState.size == size {
+                backgroundTransitionOriginalState = nil
+                snapshots = originalState.snapshots
+                coordinator.animate(alongsideTransition: nil, completion: { context in
+                    self.collectionView.reloadData()
+                })
+                return
+            } else {
+                backgroundTransitionOriginalState = (view.bounds.size, snapshots)
+            }
+        } else {
+            backgroundTransitionOriginalState = nil
+        }
+        
+        
         snapshots = nil
         forEachVisibleCell({ $0.snapshotView = nil })
         coordinator.animate(alongsideTransition: nil, completion: { context in

            panGestureRecognizer.delegate = self
            collectionView.addGestureRecognizer(panGestureRecognizer)
        }
    }
    
    override func viewDidAppear(_ animated: Bool) {
        super.viewDidAppear(animated)
        loadSnapshotsIfNeeded(animated: false)
    }
    
    func render(_ draftViewController:DraftViewControllerProtocol) -> UIView {

        fatalError("init(coder:) has not been implemented")
    }
    
    deinit {
        NotificationCenter.default.removeObserver(self)
    }
    
    override var preferredStatusBarStyle : UIStatusBarStyle {
        return .lightContent
    }
