Search code examples
iosswiftpdf-viewer

handle links clicking inside PDF viewer on iOS with swift


I have an application with PDF viewer that show an existence PDF file. that file has links, some of these links go to websites, and some links go to another pages inside the PDF itself. I use PDFDocument, is there any way to handle the clicking on those links?


Solution

  • Implement PDFViewDelegate to PDFVIew. following method in delegate trigger on link click:

    - (void)PDFViewWillClickOnLink:(PDFView *)sender withURL:(NSURL *)url
    

    Implement your logic for link handling.