-
Notifications
You must be signed in to change notification settings - Fork 11
Description
Description:
I am using the SignaturePad pod in my iOS application to capture the user's signature. The pod is working as expected when used independently. However, when I embed the SignaturePad in a UIScrollView, I encounter an issue where the scroll view is being triggered instead of the SignaturePad capturing the user's signature.
Steps to Reproduce:
Create a form with a long text, followed by a SignaturePad embedded within a container view.
The container view is added as a child view of a UIScrollView.
Try to draw a signature on the SignaturePad area.
Expected Behavior:
The signature should be captured without triggering any scrolling of the UIScrollView while the user is drawing.
Actual Behavior:
The scroll view begins to scroll when the user tries to draw a signature, making it impossible to capture the signature correctly.
My Environment:
iOS version: 18.4
Xcode version: 16.0
SignaturePad pod version: 1.0.3
Possible Cause:
It seems that the SignaturePad might not be correctly handling touch events when embedded in a scroll view, leading to the scroll view taking over touch gestures.
Additional Information:
I have verified that the issue only occurs when the SignaturePad is placed within a UIScrollView. It works fine when placed in a static view or container without any scrollable behavior.
What I Tried:
I attempted to disable scrolling of the scroll view when the signature drawing begins and re-enable it afterward after conforming my UIViewController to following SignaturePadDelegate methods:
func didStart() {
scrollView.isScrollEnabled = false
}
func didFinish() {
scrollView.isScrollEnabled = true
}
This worked partially — but only if the user draws their signature very slowly. If they draw at a normal speed, the scroll view still catches the gesture intermittently and starts scrolling. So the experience is inconsistent and not reliable for typical user behavior.
Would appreciate any insights or a fix for this behavior!