Caching

public struct Caching

A caching configuration.

  • Limits the amount of memory usage in RAM.

    Declaration

    Swift

    public let costLimit: Int
  • Limits the number of objects in RAM.

    Declaration

    Swift

    public let countLimit: Int
  • Indicates whether caching is enabled or not.

    Declaration

    Swift

    public let isEnabled: Bool
  • Initializes a new instance of CachingConfiguration with the costLimit, countLimit, and isEnabled parameters.

    Declaration

    Swift

    public init(costLimit: Int = 0, countLimit: Int = 0, isEnabled: Bool = true)

    Parameters

    costLimit

    Limits the amount of memory usage in RAM. Defaults to 0 which means unlimited. But, an OS can evict objects anytime due to memory pressure.

    countLimit

    Limits the number of objects in RAM. Defaults to 0 which means unlimited. But, an OS can evict objects anytime due to memory pressure.

    isEnabled

    Indicates whether caching is enabled or not. Defaults to true.