草庐IT

UIGraphicsEndPDFContext

全部标签

iOS 应用程序在 UIGraphicsEndPDFContext() 崩溃

我正在尝试从当前View创建PDF。下面是我的代码。funccreatePdfFromView(saveToDocumentsWithFileNamefileName:String)->CGPDFDocument?{letpdfData=NSMutableData()varpdfDoc:CGPDFDocument!UIGraphicsBeginPDFContextToData(pdfData,self.view.bounds,nil)UIGraphicsBeginPDFPage()guardletpdfContext=UIGraphicsGetCurrentContext()else{