diff --git a/FGTranslator.podspec b/FGTranslator.podspec index 215d47f..f3ab943 100644 --- a/FGTranslator.podspec +++ b/FGTranslator.podspec @@ -16,6 +16,6 @@ Pod::Spec.new do |s| s.requires_arc = true s.dependency 'AFNetworking', '~> 2.0' - s.dependency 'TMCache', '~> 2.0' + s.dependency 'PINCache', '~> 2.1' end diff --git a/FGTranslator/FGTranslator.m b/FGTranslator/FGTranslator.m index 375b838..3ab6ed5 100644 --- a/FGTranslator/FGTranslator.m +++ b/FGTranslator/FGTranslator.m @@ -10,7 +10,7 @@ #import "FGTranslateRequest.h" #import "NSString+FGTranslator.h" #import -#import +#import typedef NSInteger FGTranslatorState; @@ -73,7 +73,7 @@ - (id)initGeneric self.translatorState = FGTranslatorStateInitial; // limit translation cache to 5 MB - TMCache *cache = [TMCache sharedCache]; + PINCache *cache = [PINCache sharedCache]; cache.diskCache.byteLimit = 5000000; } @@ -87,7 +87,7 @@ + (void)flushCredentials + (void)flushCache { - [[TMCache sharedCache] removeAllObjects]; + [[PINCache sharedCache] removeAllObjects]; } - (NSString *)cacheKeyForText:(NSString *)text target:(NSString *)target @@ -107,7 +107,7 @@ - (void)cacheText:(NSString *)text translated:(NSString *)translated source:(NSS if (source) [cached setObject:source forKey:@"src"]; - [[TMCache sharedCache] setObject:cached forKey:[self cacheKeyForText:text target:target]]; + [[PINCache sharedCache] setObject:cached forKey:[self cacheKeyForText:text target:target]]; } - (void)translateText:(NSString *)text @@ -150,7 +150,7 @@ - (void)translateText:(NSString *)text } // check cache for existing translation - NSDictionary *cached = [[TMCache sharedCache] objectForKey:[self cacheKeyForText:text target:target]]; + NSDictionary *cached = [[PINCache sharedCache] objectForKey:[self cacheKeyForText:text target:target]]; if (cached) { NSString *cachedSource = [cached objectForKey:@"src"]; diff --git a/FGTranslatorDemo/Podfile b/FGTranslatorDemo/Podfile index f368d6a..e0792ac 100644 --- a/FGTranslatorDemo/Podfile +++ b/FGTranslatorDemo/Podfile @@ -3,5 +3,5 @@ platform :ios, '7.0' inhibit_all_warnings! pod 'AFNetworking', '~> 2.0' -pod 'TMCache', '~> 2.0' +pod 'PINCache', '~> 2.1' pod 'SVProgressHUD', :head