PSPDFRemoteContentObject
Objective-C
@protocol PSPDFRemoteContentObject <NSObject>
Swift
protocol RemoteContentObject : NSObjectProtocol
Contains information about remote content.
-
The URL request used for loading the remote content.
Declaration
Objective-C
@property (nonatomic, readonly, nullable) NSURLRequest *URLRequestForRemoteContent;
Swift
var urlRequestForRemoteContent: URLRequest? { get }
-
The remote content of the object. This property is managed by
PSPDFDownloadManager
.Declaration
Objective-C
@property (nonatomic, nullable) id remoteContent;
Swift
var remoteContent: Any? { get set }
-
The loading state of the object. This property is managed by
PSPDFDownloadManager
.Declaration
Objective-C
@optional @property (nonatomic, assign, unsafe_unretained, readwrite, getter=isLoadingRemoteContent) BOOL loadingRemoteContent;
Swift
optional var isLoadingRemoteContent: Bool { get set }
-
The download progress of the object. Only meaningful if
loadingRemoteContent
is YES. This property is managed byPSPDFDownloadManager
.Declaration
Objective-C
@optional @property (nonatomic, assign, unsafe_unretained, readwrite) CGFloat remoteContentProgress;
Swift
optional var remoteContentProgress: CGFloat { get set }
-
The remote content error of the object. This property is managed by
PSPDFDownloadManager
.Declaration
Objective-C
@optional @property (nonatomic, assign, unsafe_unretained, readwrite, nullable) NSError *remoteContentError;
Swift
optional var remoteContentError: Error? { get set }
-
Return YES if you want
PSPDFDownloadManager
to cache the remote content. Defaults to NO.Declaration
Objective-C
@optional @property (nonatomic, readonly) BOOL shouldCacheRemoteContent;
Swift
optional var shouldCacheRemoteContent: Bool { get }
-
Return YES if you want
PSPDFDownloadManager
to retry downloading remote content if a connection error occurred. Defaults to NO.Declaration
Objective-C
@optional @property (nonatomic, readonly) BOOL shouldRetryLoadingRemoteContentOnConnectionFailure;
Swift
optional var shouldRetryLoadingRemoteContentOnConnectionFailure: Bool { get }
-
Return a block if you need to handle a authentication challenge.
Declaration
Objective-C
@optional @property (nonatomic, readonly) PSPDFRemoteContentObjectAuthenticationBlock _Nonnull remoteContentAuthenticationChallengeBlock;
Swift
optional var remoteContentAuthenticationChallengeBlock: PSPDFRemoteContentObjectAuthenticationBlock { get }
-
Return a custom
PSPDFRemoteContentObjectTransformerBlock
. The passed-inURL
points to the file that stores the downloaded data. The return value is set toremoteContent
. If no transformer block is provided,remoteContent
will be set to data (represented byData
) of the downloaded content.Note
remoteContentTransformerBlock
will be called on a background queue, so you may perform long-running tasks.Warning
Since this runs on a background queue, you should not access state outside of the block’s scope to avoid thread-safety problems.Declaration
Objective-C
@optional @property (nonatomic, readonly, nullable) PSPDFRemoteContentObjectTransformerBlock remoteContentTransformerBlock;
Swift
optional var remoteContentTransformerBlock: PSPDFRemoteContentObjectTransformerBlock? { get }
-
Return
true
if the object actually has remote content. Since mostPSPDFRemoteContentObject
s will have remote content, this method is optional. If it is not implemented,true
will be assumed.Declaration
Objective-C
@optional @property (nonatomic, readonly) BOOL hasRemoteContent;
Swift
optional var hasRemoteContent: Bool { get }