     //MARK: Segmented control action
     func pageSegmentedControlValueChanged() {
         //Call delegate method before changing value
-        delegate?.pagerControllerSelectedIndexWillChange?(self, oldSelectedIndex: previousPageIndex, newSelectedIndex: selectedPageIndex)
+        delegate?.pagerController?(self, willChangeSelectedPageIndex: selectedPageIndex, fromPageIndex: previousPageIndex)
         
         let oldViewController = viewControllers[previousPageIndex]
         let newViewController = viewControllers[selectedPageIndex]

    
    /// Normal text color in segmented control bar
    /// Default value is UIColor.lightGray
    public var segmentedTextColor: UIColor = UIColor.lightGray {
        didSet {
            if viewIfLoaded != nil {
                updateSegmentedNormalTitleTextAttributes()

        pageScrollView.scrollsToTop = false
        pageScrollView.alwaysBounceVertical = false
        pageScrollView.contentInset = UIEdgeInsetsMake(0, 0, 49, 0)
        pageScrollView.frame = CGRect(x: 0, y: segmentedControlHeight, width: size.width, height: size.height - segmentedControlHeight)
        
        view.addSubview(pageScrollView)
    }
    
    func setUpScrollIndicator() {
        scrollIndicator.frame.size = CGSize(width: view.bounds.width/CGFloat(viewControllers.count), height: scrollIndicatorHeight)
        scrollIndicator.frame.origin.x = 0
        view.addSubview(scrollIndicator)
    }
}

