这是我的代码
func createPdfFromView(aView: UIView, saveToDocumentsWithFileName fileName: String)
{
let pdfData = NSMutableData()
UIGraphicsBeginPDFContextToData(pdfData, aView.bounds, nil)
UIGraphicsBeginPDFPage()
guard let pdfContext = UIGraphicsGetCurrentContext() else { return }
aView.layer.renderInContext(pdfContext)
UIGraphicsEndPDFContext()
if let documentDirectories = NSSearchPathForDirectoriesInDomains(.DocumentDirectory, .UserDomainMask, true).first {
let documentsFileName = documentDirectories + "/" + fileName
print(documentsFileName)
let saved = pdfData.writeToFile(documentsFileName, atomically: true)
print("Saved \(saved)")
}
}
它成功保存了我的文件。现在我想查看我的pdf文件。所以从app商店安装了adobe acrobat。 Adobe Acrobat应用程序未显示我的pdf文件。我想用adobe acrobat查看我的pdf