SDKCache

public class SDKCache
extension SDKCache: NativeBase
extension SDKCache: Hashable

A class to manage SDK Cache. Path for SDKCache is specified via SDKOptions.cachePath. SDKCache manages temporary downloaded map data during map interaction and follows LRU (least recently used) strategy to delete map data when cache size exceeds the specified SDKOptions.cacheSizeInBytes.

  • Gets a single instance of this class per provided SDKNativeEngine.

    Declaration

    Swift

    public static func fromEngine(_ sdkEngine: SDKNativeEngine) -> SDKCache

    Parameters

    sdkEngine

    Instance of an existing SDKEngine.

    Return Value

    SDKCache instance for this engine.

  • Clears all data that is currently stored in the SDK cache. Path for cache is specified by SDKOptions.cachePath. The operation can have unexpected behaviour when it is called during a map interaction, during turn-by-turn navigation (only available for the Navigate license) or during ongoing requests initiated by the OfflineSearchEngine or the OfflineRouteEngine (only available for the Navigate license).

    Declaration

    Swift

    public func clearCache(completion: @escaping CacheCallbackCompletionHandler)

    Parameters

    completion

    Callback which receives the result on the main thread.