PSPDFConflictResolutionManagerDelegate
Objective-C
@protocol PSPDFConflictResolutionManagerDelegate <NSObject>
/// Invoked when the conflict resolution selection completes.
///
/// The implementing object should resolve the file conflict (externally removed or modified file) using the
/// selected conflict resolution option.
///
/// Designed to be invoked from: `controllerForFileDeletionResolutionOnDocument:dataProvider:dataProvider:` and
/// `controllerForExternalFileChangeResolutionOnDocument:dataProvider:dataProvider:`.
///
/// @param manager A reference to the resolution manager that invoked this call.
/// @param document The current document.
/// @param dataProvider The document's data provider that detected the file change.
/// @param resolution The conflict resolution option that should be performed.
/// @param error An optional error describing the failure.
/// @return YES, if the resolution was successful and no otherwise.
- (BOOL)resolutionManager:(PSPDFConflictResolutionManager *)manager requestingFileConflictResolutionForDocument:(PSPDFDocument *)document dataProvider:(id<PSPDFCoordinatedFileDataProviding>)dataProvider withResolution:(PSPDFFileConflictResolution)resolution error:(NSError **)error;
@optional
/// Invoked just before the conflict resolution UI is displayed.
///
/// This callback can be used to suppress UI presentation and instead perform a conflict resolution
/// action immediately.
///
/// @param manager A reference to the resolution manager that invoked this call.
/// @param document The current document.
/// @param dataProvider The document's data provider that detected the file change.
/// @param type The type of conflict that is being resolved.
/// @param resolution The conflict resolution option that should be performed. A default value is passed based on the conflict type. This can be modified by assigning a new value to `*resolution`.
- (BOOL)resolutionManager:(PSPDFConflictResolutionManager *)manager shouldPerformAutomaticResolutionForForDocument:(PSPDFDocument *)document dataProvider:(id<PSPDFCoordinatedFileDataProviding>)dataProvider conflictType:(PSPDFFileConflictType)type resolution:(inout PSPDFFileConflictResolution *)resolution;
/// Specifies the view controller that should be used for UI presentation.
///
/// If not implemented or if the specified view controller is not currently being displayed,
/// the topmost view controller reachable from last known window will be used to display UI during a conflict.
///
/// @note Called on the main thread.
///
/// @param manager A reference to the resolution manager that invoked this call.
/// @return A view controller suitable for modal UI presentation.
- (UIViewController *)viewControllerForPresentationForResolutionManager:(PSPDFConflictResolutionManager *)manager;
@end
Swift
protocol ConflictResolutionManagerDelegate : NSObjectProtocol
Undocumented
-
Invoked when the conflict resolution selection completes.
The implementing object should resolve the file conflict (externally removed or modified file) using the selected conflict resolution option.
Designed to be invoked from:
controllerForFileDeletionResolutionOnDocument:dataProvider:dataProvider:
andcontrollerForExternalFileChangeResolutionOnDocument:dataProvider:dataProvider:
.Declaration
Objective-C
- (BOOL)resolutionManager:(nonnull PSPDFConflictResolutionManager *)manager requestingFileConflictResolutionForDocument: (nonnull PSPDFDocument *)document dataProvider: (nonnull id< PSPDFCoordinatedFileDataProviding>) dataProvider withResolution: (PSPDFFileConflictResolution)resolution error:(NSError *_Nullable *_Nullable) error;
Swift
func resolutionManager(_ manager: ConflictResolutionManager, requestingFileConflictResolutionFor document: PSPDFDocument, dataProvider: CoordinatedFileDataProviding, with resolution: FileConflictResolution) throws
Parameters
manager
A reference to the resolution manager that invoked this call.
document
The current document.
dataProvider
The document’s data provider that detected the file change.
resolution
The conflict resolution option that should be performed.
error
An optional error describing the failure.
Return Value
YES, if the resolution was successful and no otherwise.
-
-resolutionManager:
shouldPerformAutomaticResolutionForForDocument: dataProvider: conflictType: resolution: Invoked just before the conflict resolution UI is displayed.
This callback can be used to suppress UI presentation and instead perform a conflict resolution action immediately.
Declaration
Objective-C
- (BOOL)resolutionManager:(nonnull PSPDFConflictResolutionManager *)manager shouldPerformAutomaticResolutionForForDocument: (nonnull PSPDFDocument *)document dataProvider: (nonnull id< PSPDFCoordinatedFileDataProviding>) dataProvider conflictType:(PSPDFFileConflictType)type resolution: (inout nonnull PSPDFFileConflictResolution *) resolution;
Swift
optional func resolutionManager(_ manager: ConflictResolutionManager, shouldPerformAutomaticResolutionForFor document: PSPDFDocument, dataProvider: CoordinatedFileDataProviding, conflictType type: FileConflictType, resolution: UnsafeMutablePointer<FileConflictResolution>) -> Bool
Parameters
manager
A reference to the resolution manager that invoked this call.
document
The current document.
dataProvider
The document’s data provider that detected the file change.
type
The type of conflict that is being resolved.
resolution
The conflict resolution option that should be performed. A default value is passed based on the conflict type. This can be modified by assigning a new value to
*resolution
. -
Specifies the view controller that should be used for UI presentation.
If not implemented or if the specified view controller is not currently being displayed, the topmost view controller reachable from last known window will be used to display UI during a conflict.
Note
Called on the main thread.
Declaration
Objective-C
- (nonnull UIViewController *)viewControllerForPresentationForResolutionManager: (nonnull PSPDFConflictResolutionManager *)manager;
Swift
optional func viewControllerForPresentation(for manager: ConflictResolutionManager) -> UIViewController
Parameters
manager
A reference to the resolution manager that invoked this call.
Return Value
A view controller suitable for modal UI presentation.