PSPDFPageCellImageLoading

@protocol PSPDFPageCellImageLoading <NSObject>

This protocol is responsible for loading images and providing it to the PSPDFPageCell whenever requested by it.

  • Called by the cell if it requires a new image from the image loader.

    See

    PSPDFPageCellImageRequestToken

    Declaration

    Objective-C

    - (nonnull id<PSPDFPageCellImageRequestToken>)
    requestImageForPageAtIndex:(NSUInteger)pageIndex
                 availableSize:(CGSize)size
             completionHandler:
                 (nonnull void (^)(UIImage *_Nullable))completionHandler;

    Swift

    func requestImageForPage(at pageIndex: UInt, availableSize size: CGSize, completionHandler: @escaping (NSImage?) -> Void) -> PSPDFPageCellImageRequestToken

    Parameters

    pageIndex

    The page that should be rendered.

    size

    The available size in which the new image needs to fit.

    completionHandler

    The completion handler that you call once you have rendered the image. This can be called on any thread.

    Return Value

    A token that identifies this image request. It can be used to get more information or cancel the request.