Swift code conversion.
This commit is contained in:
parent
b64602939d
commit
2fedd36669
@ -135,7 +135,7 @@ extension PersistentCacheManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@objc public extension MVMCoreCache {
|
@objc public extension MVMCoreCache {
|
||||||
|
|
||||||
@objc func shouldSaveAtAppLevel(infoDictionary:[String: AnyHashable]) -> Bool {
|
@objc func shouldSaveAtAppLevel(infoDictionary:[String: AnyHashable]) -> Bool {
|
||||||
|
|
||||||
guard let cachePolicy = infoDictionary[KeyCachePolicy] as? Dictionary<String, Any>,
|
guard let cachePolicy = infoDictionary[KeyCachePolicy] as? Dictionary<String, Any>,
|
||||||
@ -145,8 +145,19 @@ extension PersistentCacheManager {
|
|||||||
self.isJSONExpired(infoDictionary) == false else {return false}
|
self.isJSONExpired(infoDictionary) == false else {return false}
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@objc func getPathForPersistentCachePage(pageType: String, isAppLevel appLevel: Bool) -> URL?{
|
||||||
|
|
||||||
|
if appLevel {
|
||||||
|
|
||||||
|
return PersistentCacheManager.shared.appLevelCacheDirectory.appendingPathComponent("Pages").appendingPathComponent(pageType).appendingPathExtension("json")
|
||||||
|
|
||||||
|
}else {
|
||||||
|
|
||||||
|
return PersistentCacheManager.shared.cacheDirectory.appendingPathComponent("Pages").appendingPathComponent(pageType).appendingPathExtension("json")
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -141,15 +141,6 @@ static NSString * const STATIC_CACHE_COMPONENT = @"StaticCache.txt";
|
|||||||
return [self shouldPersistentlyCacheJSON:jsonDictionary];
|
return [self shouldPersistentlyCacheJSON:jsonDictionary];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (nullable NSURL *)getPathForPersistentCachePage:(nonnull NSString *)pageType isAppLevel:(BOOL)isAppLevel{
|
|
||||||
|
|
||||||
if (isAppLevel) {
|
|
||||||
return [[[[PersistentCacheManager shared].appLevelCacheDirectory URLByAppendingPathComponent:@"Pages"] URLByAppendingPathComponent:pageType] URLByAppendingPathExtension:@"json"];
|
|
||||||
} else {
|
|
||||||
return [[[[PersistentCacheManager shared].cacheDirectory URLByAppendingPathComponent:@"Pages"] URLByAppendingPathComponent:pageType] URLByAppendingPathExtension:@"json"];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
- (nullable NSURL *)getPathForPersistentCacheModule:(nonnull NSString *)moduleName {
|
- (nullable NSURL *)getPathForPersistentCacheModule:(nonnull NSString *)moduleName {
|
||||||
return [[[[PersistentCacheManager shared].cacheDirectory URLByAppendingPathComponent:@"Modules"] URLByAppendingPathComponent:moduleName]URLByAppendingPathExtension:@"json"];
|
return [[[[PersistentCacheManager shared].cacheDirectory URLByAppendingPathComponent:@"Modules"] URLByAppendingPathComponent:moduleName]URLByAppendingPathExtension:@"json"];
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user