TouchDraw icon indicating copy to clipboard operation
TouchDraw copied to clipboard

Conflict with form sheet pull down gesture

Open igorkulman opened this issue 5 years ago • 0 comments

I have TouchDrawView in a VC that is presented as form sheet, the default behavior now on iOS 13. Trying to draw lines going roughly from top to bottom invokes the VC dismissal gesture instead of the actual drawing:

Nov-01-2019 18-54-53

According to https://stackoverflow.com/questions/56718552/disable-gesture-to-pull-down-form-page-sheet-modal-presentation the TouchDrawView should override gestureRecognizerShouldBegin and return false.

I did some experiments and adding

extension TouchDrawView {

    open override func gestureRecognizerShouldBegin(_ gestureRecognizer: UIGestureRecognizer) -> Bool {
        return !(gestureRecognizer is UIPanGestureRecognizer)
    }
}

seems to work OK, but I am not sure it is the best way to go.

igorkulman avatar Nov 01 '19 17:11 igorkulman