Index

RBDataMemoryCache.swift

Classes


RBDataMemoryCache

A managed memory cache for Data objects.

Properties

A managed memory cache for Data objects.
static public let defaultMaximumMemoryCacheSize Int { get set }

The maximum size that the cache can be in bytes.
public var maximumCacheSizeInBytes Int { get }

The current size of the cache.
public var cacheSizeInBytes Int { get }

Functions

public func storeDataItem(_ dataItem: Data, key: String, expiryInterval: TimeInterval) -> Bool

public func storeDataItem(_ dataItem: Data, key: String, group: String, expiryInterval: TimeInterval) -> Bool

public func dataItemExists(withKey key: String) -> Bool

public func dataItemExists(withKey key: String, withGroup group: String) -> Bool

public func fetchDataItem(withKey key: String) -> Data?

public func fetchDataItem(withKey key: String, withGroup group: String) -> Data?

public func removeDataItem(withKey key: String)

public func removeDataItem(withKey key: String, withGroup group: String)

Remove all of the items stored in the given group.
@param group : The group for which to remove all stored data items.
public func removeAllItems(withGroup group: String)

Removes all data items that have expired.
public func removeAllExpiredItems()