PSPDFInstantViewController


@interface PSPDFInstantViewController : PSPDFViewController

A specialized variant of PSPDFViewController that supports annotation synchronization.

Showing a document managed by Instant in any other view controller is not supported.

  • Whether the view controller should listen for server changes when visible.

    When YES, the view controller will take care of subscribing to and unsubscribing from live changes from the server when it is moved on or off screen. Note that setting this value to NO does not mean that you will not receive any changes from the server: Whenever a PSPDFInstantDocumentDescriptor is being synced, all of the related documents are updated automatically. So if, for example, you display a secondary PSPDFInstantViewController on an external display, while you are editing in a primary PSPDFInstantViewController, that secondary view controller will be updated even if it has shouldListenForServerChangesWhenVisible set to NO.

    The default value of this property is YES.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic)
        BOOL shouldListenForServerChangesWhenVisible;

    Swift

    var shouldListenForServerChangesWhenVisible: Bool { get set }
  • Triggers a one-shot sync action.

    When the document isn’t Instant enabled, or already syncing, this method does nothing. Otherwise, it triggers a one- time sync action. This is useful when you don’t want automatic syncing to reduce the energy footprint of your app.

    Declaration

    Objective-C

    - (void)syncChanges:(nullable id)sender;

    Swift

    @IBAction func syncChanges(_ sender: Any?)
  • Whether the view controller should automatically handle certain critical errors.

    If YES, when this view controller’s view is visible and a PSPDFInstantErrorIncompatibleVersion error occurs for the current document, automatic syncing will be disabled and an alert will be shown that tells the user the app must be updated.

    Defaults to YES.

    We recommended that you make your app approriately handle all errors that Instant might encounter, and then set this to NO.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) BOOL shouldShowCriticalErrors;

    Swift

    var shouldShowCriticalErrors: Bool { get set }