kitasuke / PagingMenuController

Paging view controller with customizable menu in Swift
MIT License
2.5k stars 449 forks source link

Disable left swipe when the first page is shown #201

Open danielstorch opened 8 years ago

danielstorch commented 8 years ago

Im using SWRevealViewController for my sidebar. When normally swiping, it is possible to show the sidebar. But since im also using PagingMenuController, this is not possible anymore.

It is only possible when i globally disable the scrolling like this: options.scrollEnabled = false

Is it possible to only disable the scrolling (only left swipe, the direction which should show the sidebar) of PagingMenuController when the first page is the currentPage?

zcelaloglu commented 8 years ago

same issue here!

I'm using another side menu called EnSwiftSideMenu but approach is same

kitasuke commented 8 years ago

I'll look into this issue with SWRevealViewController or EnSwiftSideMenu.

danielstorch commented 8 years ago

To fix this temporarily, we have added Screen Edge Pan Gesture Recognizer to all screens via the StoryBoard and open the side menu like this:

IBAction func screenEdgeSwiped(recognizer: UIScreenEdgePanGestureRecognizer) { if recognizer.state == .Recognized { print("Screen edge swiped!") self.revealViewController().revealToggle(self) } }

But this is only a workaround since the user doesn't get this nice feeling of sliding, the side menu just pops up when recognized edge swipe.

The Youtube App does this pretty well. If you search for something, it shows an PageView with results but the user is still able to return via edge swipe. This would be the wanted behavior.

danielstorch commented 8 years ago

Found this thread. The last example did the trick for me. It disables the FrontViewController when the menu is open and somehow makes it possible to swipe open the menu even if it is a PageView.

But the example only works for SWRevealViewController