I'm trying to run a search on a background thread using new iOS PDFKit framework.
override func main() {
if isCancelled {
return
}
pdfDocument = PDFDocument.init(url: book.document.url)!
pdfDocument.delegate = self
pdfDocument.beginFindString("test", withOptions: [.caseInsensitive, .diacriticInsensitive]) (async)
//pdfDocument.findString("test", withOptions: [.caseInsensitive, .diacriticInsensitive]) (sync)
}
The problem is that none of the PDFDocumentDelegate's methods isn't called and if I use the TIME Profiler nothing seems to happen. The sync option works but cannot be cancelled.
Any ideas?