PSPDFMemoryCache


@interface PSPDFMemoryCache : 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.

  • Undocumented

    Declaration

    Objective-C

    
    @interface PSPDFMemoryCache : NSObject
  • Undocumented

    Declaration

    Objective-C

    
    @interface PSPDFMemoryCache : NSObject
  • Initializes the memory cache with the given settings.

    This is the designated initializer.

    Declaration

    Objective-C

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

    Swift

    init(settings: PSPDFKit)

    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 (readonly, nonatomic) 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 (readonly, nonatomic) 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 (assign, readwrite, 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 (assign, readwrite, nonatomic) long long maxNumberOfPixelsUnderStress;

    Swift

    var maxNumberOfPixelsUnderStress: Int64 { get set }