PSPDFAnnotationProviderDelegate

@protocol PSPDFAnnotationProviderDelegate <NSObject>

Delegate for callbacks related to annotation saving.

  • Called after saving was successful. If there are no dirty annotations, delegates will not be called.

    Note

    annotations might not include all changes, especially if annotations have been deleted or an annotation provider didn’t implement dirtyAnnotations.

    Warning

    This is called after document providers finish saving annotations, but before the document is saved to disk. Use pdfDocumentDidSave: callback if you want to perform any actions after all changes have beed saved to disk.

    Warning

    Might be called from a background thread.

    Declaration

    Objective-C

    - (void)
    annotationProvider:(nonnull id<PSPDFAnnotationProvider>)annotationProvider
    didSaveAnnotations:(nonnull NSArray<__kindof PSPDFAnnotation *> *)annotations;

    Swift

    optional func annotationProvider(_ annotationProvider: PSPDFAnnotationProvider, didSave annotations: [PSPDFAnnotation])
  • Called after saving annotations failed. When an error occurs, annotations will not be the complete set in multi-file documents.

    Note

    annotations might not include all changes, especially if annotations have been deleted or an annotation provider didn’t implement dirtyAnnotations.

    Warning

    Might be called from a background thread.

    Declaration

    Objective-C

    - (void)annotationProvider:
                (nonnull id<PSPDFAnnotationProvider>)annotationProvider
        failedToSaveAnnotations:
            (nonnull NSArray<__kindof PSPDFAnnotation *> *)annotations
                          error:(nonnull NSError *)error;

    Swift

    optional func annotationProvider(_ annotationProvider: PSPDFAnnotationProvider, failedToSave annotations: [PSPDFAnnotation], error: Error)