InteractiveSideMenu icon indicating copy to clipboard operation
InteractiveSideMenu copied to clipboard

Adjusting Gesture Area for view?

Open jackdem opened this issue 7 years ago • 1 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

jackdem avatar Sep 07 '17 09:09 jackdem

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.

AndreyArzhannikov avatar Sep 07 '17 11:09 AndreyArzhannikov