Search code examples
iosswiftgesture

iOS Signatureview in scrollview gives issues


I have a UITableView with t.o.s, the UITableView has a footer with a SignatureView in. The problem is, when I want to draw my signature the scrollview scrolls. How can I make sure that the signature view doesn't pass gestures to the scrollview?

Storyboard


Solution

  • You have to listen for UIView Touch delegate methods touchesBegan, touchesMoved, touchesEnded

    1) Whenever touch begins or moved you have to disable the the UIScrollView as like below.

       yourScrollView.isScrollEnabled = false
    

    2) When touch ends again enables the UIScrollView as like below.

       yourScrollView.isScrollEnabled = true
    

    Here is the solution for your problem but in Objective-C, You can check for reference.