PTToolManagerObserver

@protocol PTToolManagerObserver <NSObject>

Instances of classes conforming to the PTToolManagerObserver protocol can be notified of changes in the tool manager.

  • Notifies the observer that the tool manager’s tool will change.

    Declaration

    Objective-C

    - (void)toolManager:(nonnull PTToolManager *)toolManager
        willChangeToTool:(nullable PTTool *)newTool;

    Swift

    optional func toolManager(_ toolManager: PTToolManager, willChangeTo newTool: PTTool?)

    Parameters

    toolManager

    The tool manager whose tool will change

    newTool

    The tool that the tool manager will change to

  • Notifies the observer that the tool manager’s tool has changed.

    Declaration

    Objective-C

    - (void)toolManager:(nonnull PTToolManager *)toolManager
        didChangeFromTool:(nullable PTTool *)previousTool;

    Swift

    optional func toolManager(_ toolManager: PTToolManager, didChangeFrom previousTool: PTTool?)

    Parameters

    toolManager

    The tool manager whose tool changed

    previousTool

    The previous tool, or nil if there was no previous tool

  • Raised when the tools code selects an annotation.

    Declaration

    Objective-C

    - (void)toolManager:(nonnull PTToolManager *)toolManager
        didSelectAnnotation:(nonnull PTAnnot *)annotation
               onPageNumber:(int)pageNumber;

    Swift

    optional func toolManager(_ toolManager: PTToolManager, didSelectAnnotation annotation: PTAnnot, onPageNumber pageNumber: Int32)

    Parameters

    toolManager

    The tool manager.

    annotation

    The annotation that was selected.

    pageNumber

    The page number of the PDF that the annotation was selected on.

  • This method is called when text has been copied to the specified pasteboard.

    Declaration

    Objective-C

    - (void)toolManager:(nonnull PTToolManager *)toolManager
            didCopyText:(nullable NSString *)copiedText
           toPasteboard:(nonnull UIPasteboard *)pasteboard;

    Swift

    optional func toolManager(_ toolManager: PTToolManager, didCopyText copiedText: String?, to pasteboard: UIPasteboard)

    Parameters

    toolManager

    The tool manager sending the message

    copiedText

    The text that was added to the pasteboard

    pasteboard

    The pasteboard to which the text was added

  • Raised when the tools code adds an annotation

    Declaration

    Objective-C

    - (void)toolManager:(nonnull PTToolManager *)toolManager
        annotationAdded:(nonnull PTAnnot *)annotation
           onPageNumber:(int)pageNumber;

    Swift

    optional func toolManager(_ toolManager: PTToolManager, annotationAdded annotation: PTAnnot, onPageNumber pageNumber: Int32)

    Parameters

    toolManager

    The tool manager.

    annotation

    The annotation that was added.

    pageNumber

    The page number of the PDF that the annotation was added to.

  • Raised before the tools code modifies an annotation

    Declaration

    Objective-C

    - (void)toolManager:(nonnull PTToolManager *)toolManager
        willModifyAnnotation:(nonnull PTAnnot *)annotation
                onPageNumber:(int)pageNumber;

    Swift

    optional func toolManager(_ toolManager: PTToolManager, willModifyAnnotation annotation: PTAnnot, onPageNumber pageNumber: Int32)

    Parameters

    toolManager

    The tool manager.

    annotation

    The annotation that will be modified.

    pageNumber

    The page number of the PDF that the annotation is on.

  • Raised when the tools code modifies an annotation

    Declaration

    Objective-C

    - (void)toolManager:(nonnull PTToolManager *)toolManager
        annotationModified:(nonnull PTAnnot *)annotation
              onPageNumber:(int)pageNumber;

    Swift

    optional func toolManager(_ toolManager: PTToolManager, annotationModified annotation: PTAnnot, onPageNumber pageNumber: Int32)

    Parameters

    toolManager

    The tool manager.

    annotation

    The annotation that was modified.

    pageNumber

    The page number of the PDF that the annotation is on.

  • Raised before the tools code removes an annotation

    Declaration

    Objective-C

    - (void)toolManager:(nonnull PTToolManager *)toolManager
        willRemoveAnnotation:(nonnull PTAnnot *)annotation
                onPageNumber:(int)pageNumber;

    Swift

    optional func toolManager(_ toolManager: PTToolManager, willRemoveAnnotation annotation: PTAnnot, onPageNumber pageNumber: Int32)

    Parameters

    toolManager

    The tool manager.

    annotation

    The annotation that will be removed.

    pageNumber

    The page number of the PDF that the annotation will be removed from.

  • Raised when the tools code removes an annotation

    Declaration

    Objective-C

    - (void)toolManager:(nonnull PTToolManager *)toolManager
        annotationRemoved:(nonnull PTAnnot *)annotation
             onPageNumber:(int)pageNumber;

    Swift

    optional func toolManager(_ toolManager: PTToolManager, annotationRemoved annotation: PTAnnot, onPageNumber pageNumber: Int32)

    Parameters

    toolManager

    The tool manager.

    annotation

    The annotation that was removed.

    pageNumber

    The page number of the PDF that the annotation was removed from.

  • Raised before the tools code flattens an annotation. This will be called before the willRemoveAnnotation: delegate method.

    Declaration

    Objective-C

    - (void)toolManager:(nonnull PTToolManager *)toolManager
        willFlattenAnnotation:(nonnull PTAnnot *)annotation
                 onPageNumber:(int)pageNumber;

    Swift

    optional func toolManager(_ toolManager: PTToolManager, willFlattenAnnotation annotation: PTAnnot, onPageNumber pageNumber: Int32)

    Parameters

    toolManager

    The tool manager.

    annotation

    The annotation that will be flattened.

    pageNumber

    The page number of the PDF that the annotation will be flattened onto.

  • Raised when the tools code flattens an annotation. This will be called before the annotationRemoved: delegate method.

    Declaration

    Objective-C

    - (void)toolManager:(nonnull PTToolManager *)toolManager
        annotationFlattened:(nonnull PTAnnot *)annotation
               onPageNumber:(int)pageNumber;

    Swift

    optional func toolManager(_ toolManager: PTToolManager, annotationFlattened annotation: PTAnnot, onPageNumber pageNumber: Int32)

    Parameters

    toolManager

    The tool manager.

    annotation

    The annotation that was flattened.

    pageNumber

    The page number of the PDF that the annotation was flattened onto.

  • Raised when the tools code modifies a form field annotation’s data

    Declaration

    Objective-C

    - (void)toolManager:(nonnull PTToolManager *)toolManager
        formFieldDataModified:(nonnull PTAnnot *)annotation
                 onPageNumber:(int)pageNumber;

    Swift

    optional func toolManager(_ toolManager: PTToolManager, formFieldDataModified annotation: PTAnnot, onPageNumber pageNumber: Int32)

    Parameters

    toolManager

    The tool manager.

    annotation

    The form field annotation that has modified data.

    pageNumber

    The page number of the PDF that the form field annotation is on.

  • Raised when a page has been added to the document.

    Declaration

    Objective-C

    - (void)toolManager:(nonnull PTToolManager *)toolManager
        pageAddedForPageNumber:(int)pageNumber;

    Swift

    optional func toolManager(_ toolManager: PTToolManager, pageAddedForPageNumber pageNumber: Int32)

    Parameters

    toolManager

    The tool manager.

    pageNumber

    The page number of the page that was added.

  • Raised when a page has been moved in the document.

    Declaration

    Objective-C

    - (void)toolManager:(nonnull PTToolManager *)toolManager
        pageMovedFromPageNumber:(int)oldPageNumber
                   toPageNumber:(int)newPageNumber;

    Swift

    optional func toolManager(_ toolManager: PTToolManager, pageMovedFromPageNumber oldPageNumber: Int32, toPageNumber newPageNumber: Int32)

    Parameters

    toolManager

    The tool manager.

    oldPageNumber

    The old page number of the page.

    newPageNumber

    The new page number of the page.

  • Raised when a page has been removed from the document.

    Declaration

    Objective-C

    - (void)toolManager:(nonnull PTToolManager *)toolManager
        pageRemovedForPageNumber:(int)pageNumber;

    Swift

    optional func toolManager(_ toolManager: PTToolManager, pageRemovedForPageNumber pageNumber: Int32)

    Parameters

    toolManager

    The tool manager.

    pageNumber

    The page number of the page that was removed.

  • Raised when pages will be rotated.

    Declaration

    Objective-C

    - (void)toolManager:(nonnull PTToolManager *)toolManager
        willRotatePagesForPageNumbers:(nonnull NSIndexSet *)pageNumbers;

    Swift

    optional func toolManager(_ toolManager: PTToolManager, willRotatePagesForPageNumbers pageNumbers: IndexSet)

    Parameters

    toolManager

    The tool manager.

    pageNumbers

    The page numbers of the pages that will be rotated.

  • Raised when pages have been rotated.

    Declaration

    Objective-C

    - (void)toolManager:(nonnull PTToolManager *)toolManager
        didRotatePagesForPageNumbers:(nonnull NSIndexSet *)pageNumbers;

    Swift

    optional func toolManager(_ toolManager: PTToolManager, didRotatePagesForPageNumbers pageNumbers: IndexSet)

    Parameters

    toolManager

    The tool manager.

    pageNumbers

    The page numbers of the pages that were rotated