|
@@ -106,10 +106,16 @@
|
|
|
|
|
|
@end
|
|
|
|
|
|
+static NSURLCache* _defaultURLCache = nil;
|
|
|
|
|
|
@implementation AFImageDownloader
|
|
|
|
|
|
+ (NSURLCache *)defaultURLCache {
|
|
|
+
|
|
|
+ if (_defaultURLCache) {
|
|
|
+ return _defaultURLCache;
|
|
|
+ }
|
|
|
+
|
|
|
// It's been discovered that a crash will occur on certain versions
|
|
|
// of iOS if you customize the cache.
|
|
|
//
|
|
@@ -125,6 +131,11 @@
|
|
|
diskPath:@"com.alamofire.imagedownloader"];
|
|
|
}
|
|
|
|
|
|
++ (void)setDefaultURLCache:(NSURLCache *)defaultCache {
|
|
|
+
|
|
|
+ _defaultURLCache = defaultCache;
|
|
|
+}
|
|
|
+
|
|
|
+ (NSURLSessionConfiguration *)defaultURLSessionConfiguration {
|
|
|
NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration defaultSessionConfiguration];
|
|
|
|