MMKStorageManager

@interface MMKStorageManager : NSObject

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

Summary

Instance methods

- (void)addStorageErrorListenerWithErrorListener:
    (nonnull id<MMKStorageErrorListener>)errorListener;

Subscribes to storage events

- (void)removeStorageErrorListenerWithErrorListener:
    (nonnull id<MMKStorageErrorListener>)errorListener;

Unsubscribes from storage events

- (void)computeSizeWithSizeCallback:
    (nonnull MMKStorageManagerSizeCallback)sizeCallback;

Computes storage size in bytes

- (void)clearWithClearCallback:
    (nonnull MMKStorageManagerClearCallback)clearCallback;

Removes all data

- (void)setMaxTileStorageSizeWithLimit:(long long)limit
                          sizeCallback:(nonnull MMKStorageManagerSizeCallback)
                                           sizeCallback;

Sets the maximum tile cache size to limit bytes

- (void)resetMaxTileStorageSizeWithSizeCallback:
    (nonnull MMKStorageManagerSizeCallback)sizeCallback;

Resets the tile cache size limit

- (void)maxTileStorageSizeWithSizeCallback:
    (nonnull MMKStorageManagerSizeCallback)sizeCallback;

Obtains the current storage size limit in bytes

Properties

@property (nonatomic, readonly, getter=isValid) BOOL valid;
Tells if this object is valid or no

Instance methods

addStorageErrorListenerWithErrorListener:

- (void)addStorageErrorListenerWithErrorListener:
    (nonnull id<MMKStorageErrorListener>)errorListener;

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.


removeStorageErrorListenerWithErrorListener:

- (void)removeStorageErrorListenerWithErrorListener:
    (nonnull id<MMKStorageErrorListener>)errorListener;

Unsubscribes from storage events.


computeSizeWithSizeCallback:

- (void)computeSizeWithSizeCallback:
    (nonnull MMKStorageManagerSizeCallback)sizeCallback;

Computes storage size in bytes.


clearWithClearCallback:

- (void)clearWithClearCallback:
    (nonnull MMKStorageManagerClearCallback)clearCallback;

Removes all data.


setMaxTileStorageSizeWithLimit:sizeCallback:

- (void)setMaxTileStorageSizeWithLimit:(long long)limit
                          sizeCallback:(nonnull MMKStorageManagerSizeCallback)
                                           sizeCallback;

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


resetMaxTileStorageSizeWithSizeCallback:

- (void)resetMaxTileStorageSizeWithSizeCallback:
    (nonnull MMKStorageManagerSizeCallback)sizeCallback;

Resets the tile cache size limit.


maxTileStorageSizeWithSizeCallback:

- (void)maxTileStorageSizeWithSizeCallback:
    (nonnull MMKStorageManagerSizeCallback)sizeCallback;

Obtains the current storage size limit in bytes.


Properties

valid

@property (nonatomic, readonly, getter=isValid) BOOL valid;

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.