CocoaPods trunk is moving to be read-only. Read more on the blog, there are 16 months to go.
TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Nov 2016 |
Maintained by 涂鸦.
UIWebView
, MKWebview
, adding cache managementpod try DPWebViewLocalCache
Objective-C:
#import <DPLocalCache.h>
...
- (void)viewDidLoad {
//Any place to add only once!!!
//添加浏览器本地缓存处理
DPLocalCache *urlCache = [[DPLocalCache alloc] initWithMemoryCapacity:20 * 1024 * 1024
diskCapacity:200 * 1024 * 1024
diskPath:nil
cacheTime:60*60*24
modeTybe:DOWNLOAD_MODE
subDirectory:@"PXPT"];
[NSURLCache setSharedURLCache:urlCache];
}
- (void)didReceiveMemoryWarning{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
//Any place to add only once!!!
DPLocalCache *urlCache = (DPLocalCache *)[NSURLCache sharedURLCache];
[urlCache removeAllCachedResponses];
}
...
There are three ways to use DPWebViewLocalCache in your project:
platform :ios, '7.0'
pod 'DPWebViewLocalCache', '~> 1.1.6'
If you are using Swift, be sure to add use_frameworks!
and set your target to iOS 8+:
platform :ios, '8.0'
use_frameworks!
At this point your workspace should build without error. If you are having problem, post to the Issue and the community can help you solve it.
All source code is licensed under the MIT License.