title: Display Signature View with Swift
body: <p>hi guys I'm trying to implement a YPDrwanSignatureView in my application in programmable swift! To do so I use the code below, but when I run the code, I get this error, how can I solve it?</p>
  
  <p><strong>Error:</strong></p>
  
  <pre><code> 0x10cdbf267 &lt;+519&gt;: movq   %r10, -0xc8(%rbp)
      0x10cdbf26e &lt;+526&gt;: movq   %r11, -0xd0(%rbp)
      0x10cdbf275 &lt;+533&gt;: callq  0x10ce0995e               ; symbol stub for: Swift._fatalErrorMessage(Swift.StaticString, Swift.StaticString, file: Swift.StaticString, line: Swift.UInt, flags: Swift.UInt32) -&gt; Swift.Never
      0x10cdbf27a &lt;+538&gt;: movq   -0xb0(%rbp), %rax
      0x10cdbf281 &lt;+545&gt;: movq   0x684f8(%rip), %rsi       ; "addSubview:"
  </code></pre>
  
  <p><strong>Github Project:</strong> <a href="https://github.com/GJNilsen/YPDrawSignatureView" rel="nofollow noreferrer">https://github.com/GJNilsen/YPDrawSignatureView</a></p>
  
  <p><strong>Swift Code:</strong></p>
  
  <pre><code>import UIKit
  
  class FirmaViewController: UIViewController, YPSignatureDelegate {
  
      // Connect this Outlet to the Signature View
      @IBOutlet weak var signatureView: YPDrawSignatureView!
  
      /*required init?(coder aDecoder: NSCoder) {
          fatalError("init(coder:) has not been implemented")
      }*/
  
      override func viewDidLoad() {
          super.viewDidLoad()
          // Do any additional setup after loading the view, typically from a nib.
  
          // Setting this view controller as the signature view delegate, so the didStart() and
          // didFinish() methods below in the delegate section are called.
         // signatureView.delegate = self
         self.view.addSubview(signatureView)
      }
  
      override func didReceiveMemoryWarning() {
          super.didReceiveMemoryWarning()
          // Dispose of any resources that can be recreated.
      }
  
  // Function for clearing the content of signature view
  /*@IBAction func clearSignature(_ sender: UIButton) {
      // This is how the signature gets cleared
      self.signatureView.clear()
  }
  
  // Function for saving signature
  @IBAction func saveSignature(_ sender: UIButton) {
      if let signatureImage = self.signatureView.getSignature(scale: 10) {
  
          UIImageWriteToSavedPhotosAlbum(signatureImage, nil, nil, nil)
          self.signatureView.clear()
      }
  }*/
  
  func didStart() {
      print("Started Drawing")
  }
  
  func didFinish() {
      print("Finished Drawing")
  }
  </code></pre>
  
  <p>}</p>