search for specific words inside a pdf document in Xcode

RB24 is my pdf doc. Im using a "view" inside my View Controller and the Class for that view is a PDFView.

When I see the pdf on my app, I can't do a search inside the pdf document. How can I achieve that?

When you open a pdf in your iPhone, iPhone uses an app that lets you do search and annotations on the pdf. Is there any way to do that for your app ?

Any help will be greatly appreciated !

UIKit import PDFKit

class ViewControllerRB: UIViewController {

@IBOutlet weak var PDFViewRB: PDFView! override func viewDidLoad() { super.viewDidLoad()

    let url = Bundle.main.url(forResource: "RB24", withExtension: "pdf")
    

    
    if let pdfDocument = PDFDocument(url: url!) {
        
        PDFViewRB.autoScales = true
        PDFViewRB.displayMode = .singlePageContinuous
        PDFViewRB.displayDirection = .vertical
        PDFViewRB.document = pdfDocument

Have you read the documentation on the PDFDocument class, for instance the findString(_:withOptions:) method?

search for specific words inside a pdf document in Xcode
 
 
Q