         return titles
     }
     
+    // MARK: - Gesture handler
+    
     private func addSwipeGestureHandlersIfNeeded() {
         switch options.menuDisplayMode {
         case .FlexibleItemWidth(_, let scrollingMode):

        self.constructPagingViewControllers()
        self.layoutPagingViewControllers()
        
        self.menuView.moveToMenu(page: options.defaultPage, animated: false)
        self.menuViewDidScroll(index: options.defaultPage, animated: false)
    }
    
    // MARK: - UISCrollViewDelegate
    
    public func scrollViewDidScroll(scrollView: UIScrollView) {
        if !scrollView.dragging {
            return
        }
        


import UIKit

@objc public protocol PagingMenuControllerDelegate: class {
    optional func willMoveToMenuPage(page: Int)
    optional func didMoveToMenuPage(page: Int)
}

public class PagingMenuController: UIViewController, UIScrollViewDelegate {
    
    public weak var delegate: PagingMenuControllerDelegate?
    private var options: PagingMenuOptions!
    private var menuView: MenuView!
    private var scrollView: UIScrollView!
