PSPDFFileCoordinationDelegate

@protocol PSPDFFileCoordinationDelegate<NSObject>

/**
 Called after the underlying file was modified.

 Roughly corresponds to a `presentedItemDidChange` `NSFilePresenter` notification.
 This call is only invoked if the file content changes since the last successful read.
 File metadata updates are ignored. Will be called on a private queue.

 @param dataProvider The requesting coordinated file data provider.
 */
- (void)presentedItemDidChangeForDataProvider:(id<PSPDFCoordinatedFileDataProviding>)dataProvider;

/**
 Called when the underlying file is about to be deleted.

 Corresponds to a `accommodatePresentedItemDeletionWithCompletionHandler:` `NSFilePresenter`
 notification. Will be called on a private queue.

 @note It is crucial that completionHandler is invoked after this method is handled.
 Best to do it on the same queue and not dispatching. Dispatchign to the main thread
 and invoking the callback can lead to deadlocks if the file is deleted from the main
 thread in the host app.

 @param dataProvider The requesting coordinated file data provider.
 @param completionHandler Should be invoked to allow the deletion to continue.
 */
- (void)accommodatePresentedItemDeletionForDataProvider:(id<PSPDFCoordinatedFileDataProviding>)dataProvider completionHandler:(void (^)(NSError *_Nullable))completionHandler;

@end

Undocumented

  • Called after the underlying file was modified.

    Roughly corresponds to a presentedItemDidChange NSFilePresenter notification. This call is only invoked if the file content changes since the last successful read. File metadata updates are ignored. Will be called on a private queue.

    Declaration

    Objective-C

    - (void)presentedItemDidChangeForDataProvider:
        (nonnull id<PSPDFCoordinatedFileDataProviding>)dataProvider;

    Parameters

    dataProvider

    The requesting coordinated file data provider.

  • Called when the underlying file is about to be deleted.

    Corresponds to a accommodatePresentedItemDeletionWithCompletionHandler: NSFilePresenter notification. Will be called on a private queue.

    Note

    It is crucial that completionHandler is invoked after this method is handled. Best to do it on the same queue and not dispatching. Dispatchign to the main thread and invoking the callback can lead to deadlocks if the file is deleted from the main thread in the host app.

    Declaration

    Objective-C

    - (void)accommodatePresentedItemDeletionForDataProvider:
                (nonnull id<PSPDFCoordinatedFileDataProviding>)dataProvider
                                          completionHandler:
                                              (nonnull void (^)(NSError *_Nullable))
                                                  completionHandler;

    Parameters

    dataProvider

    The requesting coordinated file data provider.

    completionHandler

    Should be invoked to allow the deletion to continue.