PSPDFInstantViewController
Objective-C
@interface PSPDFInstantViewController : PSPDFViewController
Swift
class InstantViewController : PDFViewController
A specialized variant of PDFViewController
that supports annotation synchronization.
Showing a document managed by Instant in any other view controller is not supported.
Note
Instant only supports a subset of PSPDFKit’s annotation types. As such, this class sanitizes anyPDFConfiguration
passed to its designated initializer, updateConfigurationWithBuilder:
,
or updateConfigurationWithoutReloadingWithBuilder:
.If you choose to set the builder’s
editableAnnotationTypes
to nil
, all supported annotation
types will be editable. If you set editableAnnotationTypes
to an empty set, no annotations will
be editable.
-
Whether the view controller should listen for server changes when visible.
When
true
, 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 tofalse
does not mean that you will not receive any changes from the server:
Whenever aPSPDFInstantDocumentDescriptor
is being synced, all of the related documents are updated automatically. So if, for example, you display a secondaryPSPDFInstantViewController
on an external display, while you are editing in a primaryPSPDFInstantViewController
, that secondary view controller will be updated even if it hasshouldListenForServerChangesWhenVisible
set tofalse
.The default value of this property is
true
.Declaration
Objective-C
@property (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
true
, when this view controller’s view is visible and aPSPDFInstantErrorIncompatibleVersion
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
true
.We recommended that you make your app approriately handle all errors that Instant might encounter, and then set this to
false
.Declaration
Objective-C
@property (nonatomic) BOOL shouldShowCriticalErrors;
Swift
var shouldShowCriticalErrors: Bool { get set }