Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions Classes/View/PDFKBasicPDFViewer.m
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,20 @@ - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceive

- (void)handleSingleTap:(UITapGestureRecognizer *)gestureRecognizer
{
//Ability to detect link on pdfs
PDFKBasicPDFViewerSinglePageCollectionViewCell* cell = (PDFKBasicPDFViewerSinglePageCollectionViewCell*)self.pageCollectionView.visibleCells[0];
id link = [cell.pageContentView processSingleTap:gestureRecognizer];
if ([link isKindOfClass:[NSURL class]] && [[UIApplication sharedApplication] canOpenURL:link]){
[[UIApplication sharedApplication] openURL:link];
return;
} else if ([link isKindOfClass:[NSString class]]) {
NSURL* url = [NSURL URLWithString:link];
if (url != nil && [[UIApplication sharedApplication] canOpenURL:url]){
[[UIApplication sharedApplication] openURL:url];
return;
}
}

//Check to see if the document was clicked.
if (gestureRecognizer.state == UIGestureRecognizerStateRecognized && _showingSinglePage) {
if (gestureRecognizer.numberOfTapsRequired == 1) {
Expand Down