Open PDF file using swift

前端 未结 11 2026
萌比男神i
萌比男神i 2020-11-28 04:50

How can I add a PDF file for an app , where you click on a button to view the file & when you\'re done you get back to screen you were at?

11条回答
  •  囚心锁ツ
    2020-11-28 05:30

    let openLink = NSURL(string : self.OtherContactorProfileVview.Result.CertificateList[index].CertificateFileLink)
    
            if #available(iOS 9.0, *) {
                let svc = SFSafariViewController(url: openLink! as URL)
                present(svc, animated: true, completion: nil)
            } else {
                let port : PDFViewer = UIStoryboard.init(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "PDFViewer") as! PDFViewer
                port.strUrl = self.OtherContactorProfileVview.Result.CertificateList[index].CertificateFileLink
                self.navigationController?.pushViewController(port, animated: true)
    
            }
    

提交回复
热议问题