                         bself.currentIdx = nextIdx
                     }
                 }
-                
                 })
         }
     }

    public let buttonsScrollView: LXButtonsScrollView = LXButtonsScrollView()
    /// data source required by UIpageViewController
    let pageViewControllerDataSource = LXPageViewWithButtonsViewControllerDataSource()
    var currentIdx = 0 {
        didSet {
            currentIdxUpdated()

        buttonsScrollView.selectionIndicator.frame = frame
    }
    
    func scrollButtonsViewToCurrentIndex() {
        let targetRect = buttonsScrollView.calButtonFrame(currentIdx)
        buttonsScrollView.scrollRectToVisible(targetRect, animated: true)
    }
    
    // MARK: - Buttons
    public func selectionButtonTapped(btn: UIButton) {
        let idx = btn.tag
        /// set the target index for scrolling buttons view purpose
        targetIndex = idx
        
        guard let vcs = viewControllers where idx >= 0 && idx < vcs.count else {
            return
        }
