 //
 
 import UIKit
+
+@objc
+protocol SignaturePadDelegate: class {
+    func didStart()
+    func didFinish()
+    @available(*, unavailable, renamed: "didFinish()")
+    func startedDrawing()
+    @available(*, unavailable, renamed: "didFinish()")
+    func finishedDrawing()
+}
 
 @objc
 @IBDesignable open class SignaturePad: UIView {

        path.removeAllPoints()
        dot.removeAllPoints()
        ctr = 0
    }
    
    override open func touchesCancelled(_ touches: Set<UITouch>, with event: UIEvent?) {

        if let touch = touches.first {
            ctr = 0
            points[0] = touch.location(in: self)
        }
        if let delegate = delegate {
            delegate.didStart()
        }
    }
    
