MapKit Mobile SDK

MMKStorageManager

class MMKStorageManager : NSObject

Storage manager. This is a manager that controls temporary cache storages (for example map tiles).

Summary

Instance methods

func addStorageErrorListenerWith( errorListener: MMKStorageErrorListener_)
Subscribes to storage events

func removeStorageErrorListenerWith( errorListener: MMKStorageErrorListener_)
Unsubscribes from storage events

func computeSize(sizeCallback: @escaping MMKStorageManagerSizeCallback)
Computes storage size in bytes

func clear(clearCallback: @escaping MMKStorageManagerClearCallback)
Removes all data

func setMaxTileStorageSizeWithLimit(_ limit: Int64,
                               sizeCallback: @escaping MMKStorageManagerSizeCallback)
Sets the maximum tile cache size to limit bytes

func resetMaxTileStorageSize(sizeCallback: @escaping MMKStorageManagerSizeCallback)
Resets the tile cache size limit

func maxTileStorageSize(sizeCallback: @escaping MMKStorageManagerSizeCallback)
Obtains the current storage size limit in bytes

Properties

var isValid: Bool { get }
Tells if this object is valid or no

Instance methods

addStorageErrorListenerWith(_:)

func addStorageErrorListenerWith( errorListener: MMKStorageErrorListener_)

Subscribes to storage events.

The class does not retain the object in the 'errorListener' parameter. It is your responsibility to maintain a strong reference to the target object while it is attached to a class.


removeStorageErrorListenerWith(_:)

func removeStorageErrorListenerWith( errorListener: MMKStorageErrorListener_)

Unsubscribes from storage events.


computeSize(sizeCallback:)

func computeSize(sizeCallback: @escaping MMKStorageManagerSizeCallback)

Computes storage size in bytes.


clear(clearCallback:)

func clear(clearCallback: @escaping MMKStorageManagerClearCallback)

Removes all data.


setMaxTileStorageSizeWithLimit(_:sizeCallback:)

func setMaxTileStorageSizeWithLimit(_ limit: Int64,
                               sizeCallback: @escaping MMKStorageManagerSizeCallback)

Sets the maximum tile cache size to limit bytes. When the limit is reached, old tiles are removed.


resetMaxTileStorageSize(sizeCallback:)

func resetMaxTileStorageSize(sizeCallback: @escaping MMKStorageManagerSizeCallback)

Resets the tile cache size limit.


maxTileStorageSize(sizeCallback:)

func maxTileStorageSize(sizeCallback: @escaping MMKStorageManagerSizeCallback)

Obtains the current storage size limit in bytes.


Properties

isValid

var isValid: Bool { get }

Tells if this object is valid or no. Any method called on an invalid object will throw an exception. The object becomes invalid only on UI thread, and only when its implementation depends on objects already destroyed by now. Please refer to general docs about the interface for details on its invalidation.