         if currentIdx == targetIndex {
             targetIndex = nil
         }
+        
+        pageViewWithButtonsViewDelegate?.pageViewWithButtonsView(pageViewController, buttonsScrollView: buttonsScrollView, currentIndexUpdated: currentIdx)
     }
     
     public var viewControllers : [UIViewController]? {

import Foundation
import UIKit

let LXPageViewWithButtonsViewControllerCurrentViewControllerDidChangeNotification = "LXPageViewWithButtonsViewControllerCurrentViewControllerDidChangeNotification"

public class LXPageViewWithButtonsViewController: UIViewController, UIPageViewControllerDelegate {
    /// page view controller
    public let pageViewController = UIPageViewController(transitionStyle: .Scroll, navigationOrientation: .Horizontal, options: nil)
    /// the scrollView inside the pageViewController

        buttonsScrollView.buttons.forEach { $0.selected = false }
        buttonsScrollView.buttons[currentIdx].selected = true
        
        /// scroll the scroll view if needed
        /// if the target button is already visible, then no need to scorll the view
        if !(targetIndex != nil && buttonsScrollView.isButtonVisible(targetIndex!)) {
