PTCollaborationManager

@interface PTCollaborationManager : NSObject

The object that is responsible for sending local changes to the remote server, and for receiving remote changes from the server.

  • Intializes a new PTCollaborationManager.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithToolManager:(nonnull PTToolManager *)toolManager
                                         userId:(nonnull NSString *)userId;

    Swift

    init(toolManager: PTToolManager, userId: String)

    Parameters

    toolManager

    The tool manager that this object uses to register for annotation change events that occur locally, and to push back changes that happen remotely (via its annotManager).

    userId

    The identifier for the current collaboration user.

  • The tool manager used by this object to receive local annotation change events.

    Declaration

    Objective-C

    @property (readonly, strong, nonatomic) PTToolManager *_Nonnull toolManager;

    Swift

    var toolManager: PTToolManager { get }
  • Call this method to load an initial remote annotation. This should generally be done immediately after the document itself is loaded.

    Declaration

    Objective-C

    - (void)loadInitialRemoteAnnotation:
        (nonnull PTCollaborationAnnotation *)collaborationAnnotation;

    Swift

    func loadInitialRemoteAnnotation(_ collaborationAnnotation: PTCollaborationAnnotation)

    Parameters

    collaborationAnnotation

    an object representing the collaboration annotation.

  • Call this method to load a list of initial remote annotations. This should generally be done immediately after the document itself is loaded.

    Declaration

    Objective-C

    - (void)loadInitialRemoteAnnotations:
        (nonnull NSArray<PTCollaborationAnnotation *> *)collaborationAnnotations;

    Swift

    func loadInitialRemoteAnnotations(_ collaborationAnnotations: [PTCollaborationAnnotation])

    Parameters

    collaborationAnnotations

    an array of objects representing the collaboration annotations.

  • Imports the annotations specified by the XFDF string. The imported annotations are considered to be part of the initial set of annotations.

    Declaration

    Objective-C

    - (void)importAnnotationsWithXFDFString:(nonnull NSString *)xfdfString;

    Swift

    func importAnnotations(withXFDFString xfdfString: String)

    Parameters

    xfdfString

    the XFDF string to import

  • Imports the annotations specified by the XFDF string.

    Declaration

    Objective-C

    - (void)importAnnotationsWithXFDFString:(nonnull NSString *)xfdfString
                                  isInitial:(BOOL)isInitial;

    Swift

    func importAnnotations(withXFDFString xfdfString: String, isInitial: Bool)

    Parameters

    xfdfString

    the XFDF string to import

    isInitial

    whether the imported annotations should be considered to be part of the initial set of annotations.

  • Imports the annotations specified by the XFDF command string. The command string can contain , , and tags. The imported annotations are considered to be part of the initial set of annotations.

    Declaration

    Objective-C

    - (void)importAnnotationsWithXFDFCommand:(nonnull NSString *)xfdfCommand;

    Swift

    func importAnnotations(withXFDFCommand xfdfCommand: String)

    Parameters

    xfdfCommand

    the XFDF command string to import

  • Imports the annotations specified by the XFDF command string. The command string can contain , , and tags.

    Declaration

    Objective-C

    - (void)importAnnotationsWithXFDFCommand:(nonnull NSString *)xfdfCommand
                                   isInitial:(BOOL)isInitial;

    Swift

    func importAnnotations(withXFDFCommand xfdfCommand: String, isInitial: Bool)

    Parameters

    xfdfCommand

    the XFDF command string to import

    isInitial

    whether the imported annotations should be considered to be part of the initial set of annotations.

  • Call this method to communicate a change that occured remotely that needs to be reflected on the device.

    Declaration

    Objective-C

    - (void)remoteAnnotationAdded:
        (nonnull PTCollaborationAnnotation *)collaborationAnnotation;

    Swift

    func remoteAnnotationAdded(_ collaborationAnnotation: PTCollaborationAnnotation)

    Parameters

    collaborationAnnotation

    an object representing the collaboration annotation.

  • Call this method to communicate a change that occured remotely that needs to be reflected on the device.

    Declaration

    Objective-C

    - (void)remoteAnnotationsAdded:
        (nonnull NSArray<PTCollaborationAnnotation *> *)collaborationAnnotations;

    Swift

    func remoteAnnotationsAdded(_ collaborationAnnotations: [PTCollaborationAnnotation])

    Parameters

    collaborationAnnotations

    an array of objects representing the collaboration annotations.

  • Call this method to communicate a change that occured remotely that needs to be reflected on the device.

    Declaration

    Objective-C

    - (void)remoteAnnotationModified:
        (nonnull PTCollaborationAnnotation *)collaborationAnnotation;

    Swift

    func remoteAnnotationModified(_ collaborationAnnotation: PTCollaborationAnnotation)

    Parameters

    collaborationAnnotation

    an object representing the collaboration annotation.

  • Call this method to communicate a change that occured remotely that needs to be reflected on the device.

    Declaration

    Objective-C

    - (void)remoteAnnotationsModified:
        (nonnull NSArray<PTCollaborationAnnotation *> *)collaborationAnnotations;

    Swift

    func remoteAnnotationsModified(_ collaborationAnnotations: [PTCollaborationAnnotation])

    Parameters

    collaborationAnnotations

    an array of objects representing the collaboration annotations.

  • Call this method to communicate a change that occured remotely that needs to be reflected on the device.

    Declaration

    Objective-C

    - (void)remoteAnnotationRemoved:
        (nonnull PTCollaborationAnnotation *)collaborationAnnotation;

    Swift

    func remoteAnnotationRemoved(_ collaborationAnnotation: PTCollaborationAnnotation)

    Parameters

    collaborationAnnotation

    an object representing the collaboration annotation.

  • Call this method to communicate a change that occured remotely that needs to be reflected on the device.

    Declaration

    Objective-C

    - (void)remoteAnnotationsRemoved:
        (nonnull NSArray<PTCollaborationAnnotation *> *)collaborationAnnotations;

    Swift

    func remoteAnnotationsRemoved(_ collaborationAnnotations: [PTCollaborationAnnotation])

    Parameters

    collaborationAnnotations

    an array of objects representing the collaboration annotations.

  • Establishes a connection between the PTCollaborationManager, that sends local changes to and receives remote changes from the communicationComponent.

    param communicationComponent The object that the PTCollaborationManager uses to inform the server that a local change occured, and likewise is used by the communicationComponent to inform the device that a remote change occured.

    Declaration

    Objective-C

    - (void)registerServerCommunicationComponent:
        (nonnull id<PTCollaborationServerCommunication>)communicationComponent;

    Swift

    func registerServerCommunicationComponent(_ communicationComponent: PTCollaborationServerCommunication)
  • Call to demark the end of one or more changes to a document for grouping when querying for changes to communicate to the server.

    Declaration

    Objective-C

    - (void)takeSnapshot:(nonnull NSString *)label;

    Swift

    func takeSnapshot(_ label: String)

    Parameters

    label

    A label to associate with the group of changes.