如何使用activityController将存储在iphone中的pdf保存到ibooks?
我的代码是`pageSize = CGSizeMake(850,1100)
let fileName: NSString = "Cars.pdf"
let path:NSArray = NSSearchPathForDirectoriesInDomains(.DocumentDirectory, .UserDomainMask, true)
let documentDirectory: AnyObject = path.objectAtIndex(0)
let pdfPathWithFileName = documentDirectory.stringByAppendingPathComponent(fileName as String)
self.generatePDFs(pdfPathWithFileName)
//lines written to get the document directory path for the generated pdf file.
if let documentsPath = NSFileManager.defaultManager().URLsForDirectory(.DocumentDirectory, inDomains: .UserDomainMask).first?.path {
print(documentsPath)
let File = [documentDirectory]
let activityViewController : UIActivityViewController = UIActivityViewController(activityItems: File, applicationActivities: nil)
presentViewController(activityViewController, animated: true, completion: nil)`
但它只显示邮件中的documentDirectory ..我需要说些什么..嘿,有一个pdf文件......