CacheFile

open class CacheFile : CacheEngine, @unchecked Sendable

文件缓存。复杂对象需遵循NSCoding|AnyArchivable协议

  • 单例模式

    Declaration

    Swift

    public static let shared: CacheFile
  • 缓存根目录路径

    Declaration

    Swift

    public private(set) var cachePath: String { get }
  • Undocumented

    Declaration

    Swift

    override public convenience init()
  • 指定路径

    Declaration

    Swift

    public init(path: String?)

CacheEngineProtocol

  • Undocumented

    Declaration

    Swift

    override open func readCache<T>(forKey key: String) -> T?
  • Undocumented

    Declaration

    Swift

    override open func writeCache<T>(_ object: T, forKey key: String)
  • Undocumented

    Declaration

    Swift

    override open func clearCache(forKey key: String)
  • Undocumented

    Declaration

    Swift

    override open func clearAllCaches()