Cashier
Undocumented
-
Set an
object
to theBridgingBox
and link it with akey
.- 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
- object: Generic type which confroms with
-
Check first if an object with the
key
fromBridgingBox sharedBoxCache
exists and if thekey
is valid. If an object for thatkey
exisits and thekey
is valid, return the onject ofBridgingBox sharedBoxCache
for that key, if not return nil.If the object for that
key
ofBridgingBox sharedBoxCache
does not exist check if anobjectForKey
asBridgingBox
with thatkey
exists. Else return nil. If the object exisits get the value of thatBridgingBox
and assign it toBridgingBox.sharedBoxCache
and return the object.Declaration
Swift
public func serializableForKey<T>(_ key: String) -> T? where T:Serializable
Parameters
key
Key
forBridgingBox
orobjectForKey
asString
.Return Value
Generic type stored value/object that conforms with
Serializable
or returnnil
. -
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 toSerializable
. -
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
forBridgingBox
asString
.purgeMemoryCache
If set to
true
, it will also purge the memory cache.