diff --git a/Example/PagingMenuControllerDemo2/RootViewControoler.swift b/Example/PagingMenuControllerDemo2/RootViewControoler.swift index bcac8fce..51c0e151 100644 --- a/Example/PagingMenuControllerDemo2/RootViewControoler.swift +++ b/Example/PagingMenuControllerDemo2/RootViewControoler.swift @@ -66,6 +66,10 @@ class RootViewControoler: UIViewController { case let .didMoveItem(menuItemView, previousMenuItemView): print(previousMenuItemView) print(menuItemView) + case .didScrollStart: + print("Scroll start") + case .didScrollEnd: + print("Scroll end") } } diff --git a/Pod/Classes/PagingMenuController.swift b/Pod/Classes/PagingMenuController.swift index 03537c6c..e8344a5f 100644 --- a/Pod/Classes/PagingMenuController.swift +++ b/Pod/Classes/PagingMenuController.swift @@ -312,6 +312,8 @@ open class PagingMenuController: UIViewController { extension PagingMenuController: UIScrollViewDelegate { public func scrollViewDidEndDecelerating(_ scrollView: UIScrollView) { + onMove?(.didScrollEnd) + let nextPage: Int switch (scrollView, pagingViewController, menuView) { case let (scrollView, pagingViewController?, _) where scrollView.isEqual(pagingViewController.contentScrollView): @@ -327,11 +329,7 @@ extension PagingMenuController: UIScrollViewDelegate { public func scrollViewWillBeginDragging(_ scrollView: UIScrollView) { onMove?(.didScrollStart) } - - public func scrollViewDidEndDecelerating(_ scrollView: UIScrollView, willDecelerate decelerate: Bool) { - onMove?(.didScrollEnd) - } - + public func scrollViewDidEndDragging(_ scrollView: UIScrollView, willDecelerate decelerate: Bool) { switch (scrollView, decelerate) { case (let scrollView, false) where scrollView.isEqual(menuView): break