PSPDFInstantClient


@interface PSPDFInstantClient : NSObject

The entry point to Instant, representing a client that can connect to PSPDFKit Server.

  • The URL of the directory where Instant stores documents and annotations, which is a subdirectory of Application Support.

    This may be used to set a data protection class for all Instant data as described in https://pspdfkit.com/guides/ios/current/instant/data-protection/

    This directory can be customized by subclassing and overriding this method, but there should typically be no need to do so.

    The internal structure of this directory is private.

    Declaration

    Objective-C

    @property (readonly, nonatomic, class) NSURL *_Nonnull dataDirectory;

    Swift

    class var dataDirectory: URL { get }
  • Undocumented

    Declaration

    Objective-C

    
    @interface PSPDFInstantClient : NSObject
  • Undocumented

    Declaration

    Objective-C

    
    @interface PSPDFInstantClient : NSObject
  • Initializes a new client object.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithServerURL:(nonnull NSURL *)serverURL;

    Swift

    init(serverURL: URL)

    Parameters

    serverURL

    The URL of the PSPDFKit Server the client should connect to.

    Return Value

    The newly created client.

  • The URL of the PSPDFKit Server the client connects to, as provided when creating the client;

    Declaration

    Objective-C

    @property (readonly, nonatomic) NSURL *_Nonnull serverURL;

    Swift

    var serverURL: URL { get }
  • Returns a descriptor for the document with a given identifier.

    A server client will keep a reference to the returned object and will always return the same instance if this is called again with the same identifier.

    This will fail if the document identifier is not valid.

    Declaration

    Objective-C

    - (nullable id<PSPDFInstantDocumentDescriptor>)
    documentDescriptorWithIdentifier:(nonnull NSString *)documentIdentifier
                               error:(NSError *_Nullable *_Nullable)error;

    Parameters

    documentIdentifier

    The identifier for the document used by PSPDFKit Server.

    Return Value

    A document descriptor.

  • Removes the client’s local storage from disk, including storage for all documents. This will also cancel any in-progress network operations for all the client’s documents.

    If your app has a sign out procedure, this method should be called when a user signs out.

    Errors may occur due to file system operations failing.

    Declaration

    Objective-C

    - (BOOL)removeLocalStorageWithError:(NSError *_Nullable *_Nullable)error;

    Swift

    func removeLocalStorage() throws
  • An object to be notified of download and authentication events for documents managed by this client.

    All delegate methods will be called on a background thread.

    Declaration

    Objective-C

    @property (readwrite, nonatomic)
        id<PSPDFInstantClientDelegate> _Nullable delegate;

    Swift

    weak var delegate: PSPDFInstantClientDelegate? { get set }