Revision: 9225 http://sourceforge.net/p/skim-app/code/9225 Author: hofman Date: 2017-01-28 22:20:31 +0000 (Sat, 28 Jan 2017) Log Message: ----------- PDFView documentView class is called PDFDocumentView on 10.12, and the method to get the pdfView is -getPDFView
Modified Paths: -------------- trunk/PDFDisplayView_SKExtensions.m Modified: trunk/PDFDisplayView_SKExtensions.m =================================================================== --- trunk/PDFDisplayView_SKExtensions.m 2017-01-28 21:50:53 UTC (rev 9224) +++ trunk/PDFDisplayView_SKExtensions.m 2017-01-28 22:20:31 UTC (rev 9225) @@ -47,6 +47,8 @@ @interface NSView (SKPDFDisplayViewPrivateDeclarations) - (NSRange)accessibilityRangeForSelection:(id)selection; - (id)selectionForAccessibilityRange:(NSRange)range; +- (id)pdfView; +- (id)getPDFView; @end @interface NSView (SKPDFDisplayViewAdditionalAccessibility) @@ -60,8 +62,14 @@ static id SKGetPDFView(id self) { id pdfView = nil; - @try { pdfView = [self valueForKey:@"pdfView"]; } - @catch (id exception) {} + if ([self respondsToSelector:@selector(getPDFView)]) { + pdfView = [self getPDFView]; + } else if ([self respondsToSelector:@selector(pdfView)]) { + [self pdfView]; + } else { + @try { pdfView = [self valueForKey:@"pdfView"]; } + @catch (id exception) {} + } return pdfView; } @@ -184,7 +192,7 @@ #pragma mark SKSwizzlePDFDisplayViewMethods void SKSwizzlePDFDisplayViewMethods() { - Class PDFDisplayViewClass = NSClassFromString(@"PDFDisplayView"); + Class PDFDisplayViewClass = floor(NSAppKitVersionNumber) <= NSAppKitVersionNumber10_11 ? NSClassFromString(@"PDFDisplayView") : NSClassFromString(@"PDFDocumentView"); if (PDFDisplayViewClass == Nil) return; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot _______________________________________________ Skim-app-commit mailing list Skim-app-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/skim-app-commit