Prevent drop down to dismiss gesture in modal presentations (iOS 13)#51
Prevent drop down to dismiss gesture in modal presentations (iOS 13)#51fl034 wants to merge 3 commits intodehli:masterfrom
Conversation
|
Hey @fl034, thanks for the PR! Sorry I din't see this until now. I will verify on my end and then get it merged 👍 |
|
@fl034 Are there cases where you'd want to dismiss the view and this will prevent you from being able to? |
| open override func gestureRecognizerShouldBegin(_ gestureRecognizer: UIGestureRecognizer) -> Bool { | ||
| // This prevents the drop down to dismiss gesture in modal presentations from iOS 13 on. | ||
| // See also: https://stackoverflow.com/questions/56718552/disable-gesture-to-pull-down-form-page-sheet-modal-presentation | ||
| if gestureRecognizer is UIPanGestureRecognizer { |
There was a problem hiding this comment.
You could just return !(gestureRecognizer is UIPanGestureRecognizer)
There was a problem hiding this comment.
Sure. This is just personal preference by me, to make it super easy to understand. I try to prevent ! negations, because you can overlook it so easily...
But you can change it, if you want!
@dehli yeah maybe some user has |
When TouchDrawView is embedded in a modal presentation in iOS 13, the user can drag to dismiss. This interferes with the drawing.
This PR fixes that like in the accepted answer here (method no. 3): https://stackoverflow.com/a/57635168/4846592