Digital PCT265 story MVAPCT-48 - exposing constants.
This commit is contained in:
parent
64aba6a100
commit
19c277d68e
@ -12,6 +12,9 @@
|
|||||||
#import <AVKit/AVKit.h>
|
#import <AVKit/AVKit.h>
|
||||||
@class MVMCoreErrorObject;
|
@class MVMCoreErrorObject;
|
||||||
|
|
||||||
|
extern NSString * _Nonnull const KeyCachePolicy;
|
||||||
|
extern NSString * _Nonnull const KeyCacheExpiry;
|
||||||
|
|
||||||
//block returned when getting image
|
//block returned when getting image
|
||||||
//parameters are UIImage object for the image, NSData for gif images, UIImage object for the image, A BOOL to indicate if it is a fall back image.
|
//parameters are UIImage object for the image, NSData for gif images, UIImage object for the image, A BOOL to indicate if it is a fall back image.
|
||||||
typedef void(^MVMCoreGetImageBlock)(UIImage * _Nullable, NSData * _Nullable, BOOL);
|
typedef void(^MVMCoreGetImageBlock)(UIImage * _Nullable, NSData * _Nullable, BOOL);
|
||||||
|
|||||||
@ -17,6 +17,9 @@
|
|||||||
#import "MVMCoreErrorConstants.h"
|
#import "MVMCoreErrorConstants.h"
|
||||||
#import "MVMCoreLoggingHandlerHelper.h"
|
#import "MVMCoreLoggingHandlerHelper.h"
|
||||||
|
|
||||||
|
NSString * _Nonnull const KeyCachePolicy = @"cachePolicy";
|
||||||
|
NSString * _Nonnull const KeyCacheExpiry = @"expiry";
|
||||||
|
|
||||||
@interface MVMCoreCache ()
|
@interface MVMCoreCache ()
|
||||||
|
|
||||||
// The cache for json.
|
// The cache for json.
|
||||||
@ -113,13 +116,13 @@ static NSString * const STATIC_CACHE_COMPONENT = @"StaticCache.txt";
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (nonnull NSDate *)getExpirationDateForJSON:(nonnull NSDictionary *)jsonDictionary {
|
- (nonnull NSDate *)getExpirationDateForJSON:(nonnull NSDictionary *)jsonDictionary {
|
||||||
NSDictionary *cachePolicy = [jsonDictionary dict:@"cachePolicy"];
|
NSDictionary *cachePolicy = [jsonDictionary dict:KeyCachePolicy];
|
||||||
NSTimeInterval interval = [[cachePolicy string:@"expiry"] doubleValue] / 1000;
|
NSTimeInterval interval = [[cachePolicy string:KeyCacheExpiry] doubleValue] / 1000;
|
||||||
return [NSDate dateWithTimeIntervalSince1970:interval];
|
return [NSDate dateWithTimeIntervalSince1970:interval];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL)shouldPersistentlyCacheJSON:(nonnull NSDictionary *)jsonDictionary {
|
- (BOOL)shouldPersistentlyCacheJSON:(nonnull NSDictionary *)jsonDictionary {
|
||||||
NSDictionary *cachePolicy = [jsonDictionary dict:@"cachePolicy"];
|
NSDictionary *cachePolicy = [jsonDictionary dict:KeyCachePolicy];
|
||||||
if (!cachePolicy || ![cachePolicy boolForKey:@"persist"]) {
|
if (!cachePolicy || ![cachePolicy boolForKey:@"persist"]) {
|
||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user