handsomecode / InteractiveSideMenu

iOS Interactive Side Menu written in Swift.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Adjusting Gesture Area for view?

jackdem opened this issue · comments

How can i achieve a wider recognition area for the menu pull out? currently by default its on the very edge of the view and it would be good to have a slightly wider area available

Hi @jackdem,

Currently, there is no public API to make this but you can change the behaviour by changing UIGestureRecognizer from UIScreenEdgePanGestureRecognizer to UIPanGestureRecognizer in source code here.

Example:

// Replace it
let screenEdgePanRecognizer = UIScreenEdgePanGestureRecognizer(
            target: navigationMenuTransitionDelegate.interactiveTransition,
            action: #selector(MenuInteractiveTransition.handlePanPresentation(recognizer:))
        )
screenEdgePanRecognizer.edges = .left
self.view.addGestureRecognizer(screenEdgePanRecognizer)

// with
let panRecognizer = UIPanGestureRecognizer(
            target: navigationMenuTransitionDelegate.interactiveTransition,
            action: #selector(MenuInteractiveTransition.handlePanPresentation(recognizer:))
        )
self.view.addGestureRecognizer(panRecognizer)

Hope it will help you.

Thanks for asking the question. We added this request to to-do list.