CosmicMind / Material

A UI/UX framework for creating beautiful applications.
http://cosmicmind.com
MIT License
11.99k stars 1.26k forks source link

tapGesture in SideNavigationController.swift cancels out UITableView didSelectRowAtIndexPath #137

Closed mattjennings closed 8 years ago

mattjennings commented 8 years ago

The tapGesture in SideNavigationController.swift cancels out the touch events in the side views. I've only encountered this with a UITableView that I had in the side view controller. didSelectRowAtIndexPath wasn't being called but once I set cancelsTouchesInView to "false" it all worked properly.

Fixed by adding

tap?.cancelsTouchesInView = false

to

private func prepareGestures(inout pan: UIPanGestureRecognizer?, panSelector: Selector, inout tap: UITapGestureRecognizer?, tapSelector: Selector) {
        removeGestures(&panGesture, tap: &tapGesture)

        if nil == pan {
            pan = UIPanGestureRecognizer(target: self, action: panSelector)
            pan!.delegate = self
            view.addGestureRecognizer(pan!)
        }

        if nil == tap {
            tap = UITapGestureRecognizer(target: self, action: tapSelector)
            tap?.cancelsTouchesInView = false
            tap!.delegate = self
            view.addGestureRecognizer(tap!)
        }
    }
daniel-jonathan commented 8 years ago

Excellent, thank you! We will add this in our next release today. I will leave this up until the fix is made, and then notify you and close this issue.

daniel-jonathan commented 8 years ago

This is now fixed in 1.29.2, which will be out shortly. Thank you!