我正在使用 ResearchKit 制作企业应用程序。
我现在正在制作一个包含收集的答案并通过电子邮件发送的 pdf。
我知道,如果您有一份同意文件,这就是它的代码:
ConsentDocument .makePDFWithCompletionHandler({ (NSData pdfFile, NSError error) -> Void in
// println("pdf created")
// finding document path //TODO: Remove if not needed
let documentsPath = NSSearchPathForDirectoriesInDomains(.DocumentDirectory, .UserDomainMask, true)[0] .stringByAppendingPathComponent("Consent.pdf")
pdfFile!.writeToFile(documentsPath, atomically: false)
println(consentDocumentFromDirectory)
})
但是,如果我没有同意文件怎么办?
我应该如何创建pdf?