         menuView.addGestureRecognizer(rightSwipeGesture)
     }
     
+    // MARK: - Page controller
+    
+    private func moveToMenuPage(page: Int, animated: Bool) {
+        currentPage = page
+        currentViewController = pagingViewControllers[page]
+        
+        delegate?.willMoveToMenuPage?(currentPage)
+        
+        menuView.moveToMenu(page: currentPage, animated: animated)
+        
+        let duration = animated ? options.animationDuration : 0
+        UIView.animateWithDuration(duration, animations: { [unowned self] () -> Void in
+            self.scrollView.contentOffset.x = self.scrollView.frame.width * CGFloat(page)
+            }) { (finished: Bool) -> Void in
+                if finished {
+                    self.delegate?.didMoveToMenuPage?(self.currentPage)
+                }
+        }
+    }
+    
+    // MARK: - Page calculator
+    
     private func currentPagingViewPage() -> Int {
         let pageWidth = self.scrollView.frame.width
         
         return Int(floor((self.scrollView.contentOffset.x - pageWidth / 2) / pageWidth)) + 1
     }
     
-    private func targetIndex(#tappedIndex: Int) -> Int {
+    private func targetPage(#tappedPage: Int) -> Int {
         switch options.menuDisplayMode {
         case .FlexibleItemWidth(_, let scrollingMode):
             switch scrollingMode {
             case .PagingEnabled:
-                return tappedIndex < currentPage ? currentPage-1 : currentPage+1
+                return tappedPage < currentPage ? currentPage-1 : currentPage+1
             default:
-                return tappedIndex
+                return tappedPage
             }
         case .FixedItemWidth(_, _, let scrollingMode):
             switch scrollingMode {
             case .PagingEnabled:
-                return tappedIndex < currentPage ? currentPage-1 : currentPage+1
+                return tappedPage < currentPage ? currentPage-1 : currentPage+1
             default:
-                return tappedIndex
+                return tappedPage
             }
         case .SegmentedControl:
-            return tappedIndex
+            return tappedPage
         }
     }
     

        }
    }
    
    // MARK: - HomeMenuViewDelegate
    
    internal func menuViewDidScroll(#index: Int, animated: Bool) {
        currentPage = index
        currentViewController = pagingViewControllers[index]
        
        let duration = animated ? options.animationDuration : 0
        UIView.animateWithDuration(duration, animations: { [unowned self] () -> Void in
            self.scrollView.contentOffset.x = self.scrollView.frame.width * CGFloat(index)
        })
    }
    
    // MARK: - UIGestureRecognizer
    
    internal func handleTapGesture(recognizer: UITapGestureRecognizer) {
        let tappedMenuView = recognizer.view as! MenuItemView
        if let tappedIndex = find(menuView.menuItemViews, tappedMenuView) where tappedIndex != currentPage {
            let index = self.targetIndex(tappedIndex: tappedIndex)
            menuView.moveToMenu(page: index, animated: true)
            self.menuViewDidScroll(index: index, animated: true)
        }
    }
    
    internal func handleSwipeGesture(recognizer: UISwipeGestureRecognizer) {
        var newPageIndex = currentPage
        if recognizer.direction == .Left {
            newPageIndex = min(++newPageIndex, menuView.menuItemViews.count - 1)
        } else if recognizer.direction == .Right {
            newPageIndex = max(--newPageIndex, 0)
        }
        menuView.moveToMenu(page: newPageIndex, animated: true)
        self.menuViewDidScroll(index: newPageIndex, animated: true)
    }
    
    // MARK: - Private method
    
    private func constructMenuView() {
        menuView = MenuView(menuItemTitles: self.menuItemTitles(), options: options)

        self.constructPagingViewControllers()
        self.layoutPagingViewControllers()
        
        currentPage = self.options.defaultPage
        currentViewController = pagingViewControllers[self.options.defaultPage]
    }
    
    // MARK: - UISCrollViewDelegate
    
    public func scrollViewDidScroll(scrollView: UIScrollView) {
        if !scrollView.isEqual(self.scrollView) || !scrollView.dragging {
            return
        }
        
