             })
         }
     }
+    
+    /// Update the controller for a new current index.
+    ///
+    /// - Parameters:
+    ///   - currentIndex: The new current index.
+    ///   - oldValue: The previous current index.
+    private func updateForNewCurrentIndex(_ currentIndex: PageIndex, from oldValue: PageIndex?) {
+        
+        #if os(iOS)
+            UIView.animate(withDuration: 0.3) {
+                self.setNeedsStatusBarAppearanceUpdate()
+            }
+        #endif
+        
+        // ensure position keeps in sync
+        self.currentPosition = CGPoint(x: self.navigationOrientation == .horizontal ? CGFloat(currentIndex) : 0.0,
+                                       y: self.navigationOrientation == .vertical ? CGFloat(currentIndex) : 0.0)
+        let direction = NavigationDirection.forPosition(CGFloat(currentIndex),
+                                                        previous: CGFloat(oldValue ?? currentIndex))
+        self.delegate?.pageboyViewController(self,
+                                             didScrollToPageAt: currentIndex,
+                                             direction: direction,
+                                             animated: self.isScrollingAnimated)
+    }
 }

        didSet {
            guard let currentIndex = self.currentIndex else { return }

            #if os(iOS)
            UIView.animate(withDuration: 0.3) { 
                self.setNeedsStatusBarAppearanceUpdate()
            }
            #endif
            
            // ensure position keeps in sync
            self.currentPosition = CGPoint(x: self.navigationOrientation == .horizontal ? CGFloat(currentIndex) : 0.0,
                                           y: self.navigationOrientation == .vertical ? CGFloat(currentIndex) : 0.0)
            let direction = NavigationDirection.forPosition(CGFloat(currentIndex),
                                                            previous: CGFloat(oldValue ?? currentIndex))
            self.delegate?.pageboyViewController(self,
                                                 didScrollToPageAt: currentIndex,
                                                 direction: direction,
                                                 animated: self.isScrollingAnimated)

        }
    }
    /// The relative page position that the page view controller is currently at.

    }
    
    
    // MARK: Actions
    
    /// Scroll the page view controller to a new page.
    ///
