swift CGPDFDocument parsing
问题 I'm trying to use Swift to parse the contents of PDF documents, following Apple's programming guide (in which all the examples are ObjC...) let filepath = "/Users/ben/Desktop/Test.pdf" let localUrl = filepath as CFString if let pdfURL = CFURLCreateWithFileSystemPath(nil, localUrl, CFURLPathStyle.cfurlposixPathStyle, false) { if let pdf = CGPDFDocument(pdfURL) { if let inf = pdf.info { CGPDFDictionaryApplyFunction(inf, { (key, object, info) -> Void in print("\(key), \(object), \(info)") }, nil