Cashier

Undocumented

  • Set an object to the BridgingBox and link it with a key.

    • object: Generic type which confroms with Serializable.
    • key: Key as a String.

    Declaration

    Swift

    public func setSerializable<T>(_ object: T, forKey key: String) where T: Serializable
  • Check first if an object with the key from BridgingBox sharedBoxCache exists and if the key is valid. If an object for that key exisits and the key is valid, return the onject of BridgingBox sharedBoxCache for that key, if not return nil.

    If the object for that key of BridgingBox sharedBoxCache does not exist check if an objectForKey as BridgingBox with that key exists. Else return nil. If the object exisits get the value of that BridgingBox and assign it to BridgingBox.sharedBoxCache and return the object.

    Declaration

    Swift

    public func serializableForKey<T>(_ key: String) -> T? where T:Serializable

    Parameters

    key

    Key for BridgingBox or objectForKey as String.

    Return Value

    Generic type stored value/object that conforms with Serializable or return nil.

  • Clears all saved disk data and optionally purges all memory caches.

    Declaration

    Swift

    public func clearAllData(_ purgeMemoryCaches: Bool)

    Parameters

    purgeMemoryCaches

    If set to true, it will also purge all memory caches, including the shared bridging box cache for objects adhering to Serializable.

  • Removes a serializable value from saved disk, and optionally the memory cache.

    Declaration

    Swift

    public func deleteSerializableForKey(_ key: String, purgeMemoryCache purge: Bool = true)

    Parameters

    key

    Key for BridgingBox as String.

    purgeMemoryCache

    If set to true, it will also purge the memory cache.