PSPDFMemoryCache

Objective-C


@interface PSPDFMemoryCache : NSObject

Swift

class MemoryCache : NSObject

The memory cache holds images in memory to give the render engine access to them as fast as possible. By default its memory constraints are configured to get the best performance out of the current device.

  • Unavailable

    Not the designated initializer

    Undocumented

    Declaration

    Objective-C

    PSPDF_EMPTY_INIT_UNAVAILABLE
  • Unavailable

    Not the designated initializer

    Undocumented

    Declaration

    Objective-C

    PSPDF_EMPTY_INIT_UNAVAILABLE
  • The designated initializer. Initializes the memory cache with the given settings.

    This is the designated initializer.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithSettings:(nonnull PSPDFKitGlobal *)settings;

    Swift

    init(settings: PSPDFKitGlobal)

    Parameters

    settings

    The settings to use for the cache store.

    Return Value

    A newly initialized memory cache.

  • Number of objects that are currently in the cache.

    Declaration

    Objective-C

    @property (nonatomic, readonly) NSUInteger count;

    Swift

    var count: UInt { get }
  • Tracks the current amount of pixels cached.

    One pixel roughly needs 4 byte (+ structure overhead).

    Declaration

    Objective-C

    @property (nonatomic, readonly) long long numberOfPixels;

    Swift

    var numberOfPixels: Int64 { get }
  • Maximum number of pixels allowed to be cached.

    The default is a device dependent value.

    Declaration

    Objective-C

    @property (nonatomic) long long maxNumberOfPixels;

    Swift

    var maxNumberOfPixels: Int64 { get set }
  • Maximum number of pixels allowed to be cached when the device is under stress (e.g. when a memory warning arrives).

    The default is a device dependent value.

    Declaration

    Objective-C

    @property (nonatomic) long long maxNumberOfPixelsUnderStress;

    Swift

    var maxNumberOfPixelsUnderStress: Int64 { get set }