CacheEngine
open class CacheEngine : NSObject, CacheProtocol, CacheEngineProtocol
缓存引擎基类,自动管理缓存有效期,线程安全。复杂对象需遵循NSCoding|AnyArchivable协议
-
Undocumented
Declaration
Swift
override public init()
-
Declaration
Swift
open func object(forKey key: String) -> Any?
-
Declaration
Swift
open func setObject(_ object: Any?, forKey key: String)
-
Declaration
Swift
open func setObject(_ object: Any?, forKey key: String, withExpire expire: TimeInterval)
-
Declaration
Swift
open func removeObject(forKey key: String)
-
Declaration
Swift
open func removeAllObjects()
-
Declaration
Swift
open func readCache(forKey key: String) -> Any?
-
Declaration
Swift
open func writeCache(_ object: Any, forKey key: String)
-
Declaration
Swift
open func clearCache(forKey key: String)
-
Declaration
Swift
open func clearAllCaches()