Material: SideNavigationController gestures in conflict with the rootViewController subview gestures

Created on 19 Apr 2016  路  11Comments  路  Source: CosmicMind/Material

Hi,

I've a NavigationController as the rootViewController of a SideNavigationController. The embedded ViewController of the NavigationController has a document viewer/editor (PSPDFKit) as a subview. This subview (the document editor) requires tap gestures and pan gestures for annotations. But the gestures require by the document editor are "hidden" by the SideNavigationController gestures.

I've the same issue (behavior) after having disabled the left and right view with the enabled properties :

override func viewWillAppear(animated: Bool) {
    super.viewWillAppear(animated)
    sideNavigationController?.enabled = false
}

override func viewWillDisappear(animated: Bool) {
    super.viewWillDisappear(animated)
    sideNavigationController?.enabled = true
}

Is there an other way to disable gestures for a sideNavigationController ?
Or make the functions prepareGestures() and removeGestures() public ?

Thanks for all you did

help wanted

All 11 comments

I will be revisiting the pan gestures later today. Let me see what is possible :)

By the way it seems that SideNavigationController's swipe gesture (for leftView) on rootViewController override the "swipe to delete" gesture, if the rootViewController is a UITableViewController that implements "swipe to delete" feature

the problem is common also with UIControl subclasses. An easy solution is to make the remove/add gesture recognisers public. Dirty but works until the maintainer fixes the issue.

@Bashta
@danieldahan has fixed the issue and will be released soon.

Nice! Is there a branch with the fix already available?

I'm afraid not.
But if you want to live on the edge and enjoy the development with others, you can always use the development branch and participate in the Gitter Room's chat.

+1 to karma +3 to friendship

@xaviermawet Please try 1.40.0 and let me know if the issue is fixed. I am closing the issue for now, please reopen or create a new one if the issue persists.

It works like a charms :D Thanks for all you did

Yeah works really well!

Did you reduce the threshold ? It seems that it more difficult to get the swipe the sideView.

But it is really ok though ! 馃憤

@havocked awesome. Yes I lowered it so it wouldn't be so far out. Maybe it is too little. To adjust the value, you can set rightThreshold, and leftThreshold on the SideNavigationController instance.

override func viewWillAppear(animated: Bool) {
        super.viewWillAppear(animated)
sideNavigationController?.leftThreshold = 64
sideNavigationController?.rightThreshold = 64
}

If you find a better value to use as the default, please let me know.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sovata8 picture sovata8  路  15Comments

PuneetKohli picture PuneetKohli  路  14Comments

timoschwarzer picture timoschwarzer  路  19Comments

kylebrowning picture kylebrowning  路  15Comments

tato469 picture tato469  路  17Comments