1

when I click the btnPDFGenerator in the iPhone the xCode was displayed the error:

Thread 1: EXC_BREAKPOINT (code=1, subcode=0x100e0c304)

this is my code

https://image.ibb.co/d9qfCb/image.png

  @IBAction func pdf(_ sender: UIButton)
{
    let dst = NSHomeDirectory() + "/test.pdf"
    try! PDFGenerator.generate(self.Scrollview, to: dst) <- // i got error here
    openPDFViewer(dst)
}



fileprivate func openPDFViewer(_ pdfPath: String) {
    let url = URL(fileURLWithPath: pdfPath)
    let storyboard = UIStoryboard(name: "PDFPreviewVC", bundle: nil)
    let vc = storyboard.instantiateInitialViewController() as! PDFPreviewVC
    vc.setupWithURL(url)
    present(vc, animated: true, completion: nil)
}
faten
  • 25
  • 6

0 Answers0