PSPDFConflictResolutionManager

Objective-C


@interface PSPDFConflictResolutionManager : NSObject <PSPDFOverridable>

Swift

class ConflictResolutionManager : NSObject, Overridable

Handles conflict resolution UI presentation in response to a PSPDFDocumentUnderlyingFileChangedNotification. Invokes the delegate to perform the selected conflict resolution option when done.

Warning

This class manages UI and it’s methods should only be used on the main thread.
  • An object performing the selected conflict resolution actions.

    Declaration

    Objective-C

    @property (nonatomic, weak) id<PSPDFConflictResolutionManagerDelegate> _Nullable delegate;

    Swift

    weak var delegate: ConflictResolutionManagerDelegate? { get set }
  • Parses the change notification and presents an appropriate UI for conflict resolution.

    Declaration

    Objective-C

    - (void)handleUnderlyingFileChangedNotification:
        (nonnull NSNotification *)notification;

    Swift

    func handleUnderlyingFileChangedNotification(_ notification: Notification)

    Parameters

    notification

    A forwarded PSPDFDocumentUnderlyingFileChangedNotification notification object.

  • Presents UI for file conflict resolution for a deleted source file.

    The presented actions should invoke the resolutionManager:requestingFileConflictResolutionForDocument:dataProvider:withResolution:, delegate passing the document, dataProvider and the selected conflict resolution option.

    Declaration

    Objective-C

    - (nullable UIViewController *)
        controllerForFileDeletionResolutionOnDocument:
            (nonnull PSPDFDocument *)document
                                         dataProvider:
                                             (nonnull id<
                                                 PSPDFCoordinatedFileDataProviding>)
                                                 dataProvider;

    Parameters

    document

    The document who’s file was deleted.

    dataProvider

    The data provider that detected the change and can be used for conflict resolution.

    Return Value

    A view controller with conflict resolution options. By default a UIAlertController instance. If nil is returned, no UI will be presented an a default resolution applied (removing the document from the view controller).

  • Presents UI for file conflict resolution for an externally modified source file.

    The presented actions should invoke the resolutionManager:requestingFileConflictResolutionForDocument:dataProvider:withResolution:, delegate passing the document, dataProvider and the selected conflict resolution option.

    Declaration

    Objective-C

    - (nullable UIViewController *)
        controllerForExternalFileChangeResolutionOnDocument:
            (nonnull PSPDFDocument *)document
                                               dataProvider:
                                                   (nonnull id<
                                                       PSPDFCoordinatedFileDataProviding>)
                                                       dataProvider;

    Parameters

    document

    The document who’s file was externally modified.

    dataProvider

    The data provider that detected the change and can be used for conflict resolution

    Return Value

    A view controller with conflict resolution options. By default a UIAlertController instance. If nil is returned, no UI will be presented an a default resolution applied (reloading the document to reflect the external change).