Skip to content

PDFKit macOS xcode14.0 beta1

TJ Lambert edited this page Aug 4, 2022 · 3 revisions

#PDFKit.framework https://github.com/xamarin/xamarin-macios/pull/15628

diff -ruN /Applications/Xcode_13.3.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/PDFKit.framework/Headers/PDFKitPlatform.h /Applications/Xcode_14.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/PDFKit.framework/Headers/PDFKitPlatform.h
--- /Applications/Xcode_13.3.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/PDFKit.framework/Headers/PDFKitPlatform.h	2022-02-23 08:01:03.000000000 -0500
+++ /Applications/Xcode_14.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/PDFKit.framework/Headers/PDFKitPlatform.h	2022-05-31 14:50:39.000000000 -0400
@@ -64,6 +64,7 @@
 #define PDFKitPlatformButtonCell                                NSButtonCell
 #define PDFKitPlatformAccessibilityElement                      NSAccessibilityElement
 #define PDFKitResponder                                         NSResponder
+#define PDFKitTextContentType                                   NSTextContentType
 
 // Geometry types
 #define PDFPoint                                                NSPoint
@@ -76,6 +77,7 @@
 #define PDFSizeZero                                             NSZeroSize
 #define PDFRectZero                                             NSZeroRect
 #define PDFEdgeInsetsZero                                       NSEdgeInsetsZero
+#define PDFTrackingRunLoopMode                                  NSEventTrackingRunLoopMode
 
 #elif (TARGET_OS_SIMULATOR || TARGET_OS_IPHONE || TARGET_OS_MACCATALYST)
 
@@ -111,6 +113,7 @@
 #define PDFKitPlatformButtonCell                                UICollectionViewCell
 #define PDFKitPlatformAccessibilityElement                      UIAccessibilityElement
 #define PDFKitResponder                                         UIResponder
+#define PDFKitTextContentType                                   UITextContentType
 
 // Geometry types
 #define PDFPoint                                                CGPoint
@@ -123,6 +126,7 @@
 #define PDFSizeZero                                             CGSizeZero
 #define PDFRectZero                                             CGRectZero
 #define PDFEdgeInsetsZero                                       UIEdgeInsetsZero
+#define PDFTrackingRunLoopMode                             UITrackingRunLoopMode
 
 #else
 
diff -ruN /Applications/Xcode_13.3.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/PDFKit.framework/Headers/PDFPageOverlayViewProvider.h /Applications/Xcode_14.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/PDFKit.framework/Headers/PDFPageOverlayViewProvider.h
--- /Applications/Xcode_13.3.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/PDFKit.framework/Headers/PDFPageOverlayViewProvider.h	1969-12-31 19:00:00.000000000 -0500
+++ /Applications/Xcode_14.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/PDFKit.framework/Headers/PDFPageOverlayViewProvider.h	2022-05-21 08:49:04.000000000 -0400
@@ -0,0 +1,37 @@
+//
+//  PDFPageOverlayViewProvider.h
+//  PDFKit
+//
+//  Copyright © 2022 Apple. All rights reserved.
+//
+
+#import <PDFKit/PDFKitPlatform.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@class PDFPage, PDFView;
+
+/* PDFPageOverlayViewProvider allows a client to provide views that will be overlaid onto each PDFPage.
+*/
+
+@protocol PDFPageOverlayViewProvider <NSObject>
+
+@required
+
+// Return a "prepared" overlay view
+- (nullable PDFKitPlatformView*)overlayViewForPage:(PDFPage*)page;
+
+// Perform teardown of the overlay view
+- (void)relinquishOverlayViewForPage:(PDFPage*)page;
+
+@optional
+
+// Called when the overlay view has been added to its superview, and constraints have been applied
+- (void)overlayViewWasInstalledForPage:(PDFPage*)page;
+
+// Called before the overlay view is removed from its superview
+- (void)overlayViewWillBeUninstalledForPage:(PDFPage*)page;
+
+@end
+
+NS_ASSUME_NONNULL_END
diff -ruN /Applications/Xcode_13.3.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/PDFKit.framework/Headers/PDFView.h /Applications/Xcode_14.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/PDFKit.framework/Headers/PDFView.h
--- /Applications/Xcode_13.3.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/PDFKit.framework/Headers/PDFView.h	2022-02-23 10:59:40.000000000 -0500
+++ /Applications/Xcode_14.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/PDFKit.framework/Headers/PDFView.h	2022-05-31 14:50:39.000000000 -0400
@@ -18,7 +18,7 @@
 NS_ASSUME_NONNULL_BEGIN
 
 @class PDFAction, PDFActionRemoteGoTo, PDFDestination, PDFSelection, PDFViewPrivate;
-@protocol PDFViewDelegate;
+@protocol PDFViewDelegate, PDFPageOverlayViewProvider;
 
 // Display modes.
 PDFKIT_ENUM_AVAILABLE(10_4, 11_0)
@@ -84,7 +84,7 @@
 #if defined(PDFKIT_PLATFORM_OSX)
     < NSAnimationDelegate, NSMenuDelegate >
 #elif defined(PDFKIT_PLATFORM_IOS)
-    < UIGestureRecognizerDelegate >
+    < UIGestureRecognizerDelegate, UIFindInteractionDelegate >
 #endif
 {
 @private
@@ -195,6 +195,9 @@
 
 @property (nonatomic, weak, nullable) id< PDFViewDelegate > delegate;
 
+@property (nonatomic, weak, nullable) id<PDFPageOverlayViewProvider> pageOverlayViewProvider PDFKIT_AVAILABLE(13_0, 16_0);
+
+
 // -------- scaling
 
 // Method to get / set the current scaling on the displayed PDF document. Default is 1.0 (actual size).
@@ -357,6 +360,23 @@
 // temporary annotations and are not saved.
 @property (nonatomic) BOOL enableDataDetectors PDFKIT_AVAILABLE(10_6, 11_0);
 
+// If YES, page overlay views will be hit tested and therefore receive gestures. If NO, PDFView will receive gestures,
+// namely those for text selection.
+@property (nonatomic, getter=isInMarkupMode) BOOL inMarkupMode PDFKIT_AVAILABLE(13_0, 16_0);
+
+
+// -------- find interaction
+
+#if defined(PDFKIT_PLATFORM_IOS)
+
+/// If `findInteractionEnabled` is set to true, returns the receiver's built-in find interaction. Otherwise, nil.
+@property (nonatomic, readonly) UIFindInteraction *findInteraction PDFKIT_AVAILABLE(NA, 16_0);
+
+/// Enables the built-in find interaction.
+@property (nonatomic, readwrite, getter=isFindInteractionEnabled) BOOL findInteractionEnabled PDFKIT_AVAILABLE(NA, 16_0);
+
+#endif
+
 @end
 
 @protocol PDFViewDelegate< NSObject >
Clone this wiki locally