         return BarItem(title: "Page No. \(index + 1)")
     }
 }
+
+private extension TabPageViewController {
+    
+    private func gradientOffset(for position: CGFloat) -> CGFloat {
+        return position / CGFloat((self.pageCount ?? 1) - 1)
+    }
+}

        
        //        print("didScrollToPageAtIndex: \(index)")
        
        gradient?.gradientOffset = CGFloat(index) / CGFloat((pageboyViewController.pageCount ?? 1) - 1)
        statusView.currentIndex = index
        updateBarButtonsForCurrentIndex()
    }

        //        print("didScrollToPosition: \(position)")
        
        let relativePosition = navigationOrientation == .vertical ? position.y : position.x
        gradient?.gradientOffset = gradientOffset(for: relativePosition)
        statusView.currentPosition = relativePosition
        
        updateBarButtonsForCurrentIndex()
