Search code examples
iosuigesturerecognizerecslidingviewcontrollerecslidingviewcontroller-2

Preventing Sliding When Top View is Off Screen


So I've been playing around with the examples included with ECSlidingView.

In the BasicMenu Example: I've placed 20 rows in the Settings table view. When I open the menu, the table view in settings continues to slide if I touch it.

In the TransitionFun Example, the table views are not slide-able when they're not full screen.

I've looked through the code and don't see what's causing this difference. Can someone point it out to me? I have an app that pretty much started as BasicMenu and I sometimes have trouble using the pan gesture to close the menu, because I end up accidentally sliding the mostly off screen table view instead.

Thanks!


Solution

  • Look at setting:

    slidingController.topViewAnchoredGesture = ECSlidingViewControllerAnchoredGesturePanning | ECSlidingViewControllerAnchoredGestureTapping;
    

    such that, when the top view is anchored, tapping and panning it will both result in sliding. This eliminates the ability to otherwise interact with the top view controller contents.