YMKStorageManager

@interface YMKStorageManager : NSObject

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

Summary

Instance methods

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

Subscribes to storage events

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

Unsubscribes from storage events

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

Computes storage size in bytes

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

Removes all data

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

Sets the maximum tile cache size to limit bytes

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

Resets the tile cache size limit

- (void)maxTileStorageSizeWithSizeCallback:
    (nonnull YMKStorageManagerSizeCallback)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<YMKStorageErrorListener>)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<YMKStorageErrorListener>)errorListener;

Unsubscribes from storage events.


computeSizeWithSizeCallback:

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

Computes storage size in bytes.


clearWithClearCallback:

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

Removes all data.


setMaxTileStorageSizeWithLimit:sizeCallback:

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

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


resetMaxTileStorageSizeWithSizeCallback:

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

Resets the tile cache size limit.


maxTileStorageSizeWithSizeCallback:

- (void)maxTileStorageSizeWithSizeCallback:
    (nonnull YMKStorageManagerSizeCallback)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.