Our app is serving content in UIWebView which can link to PDF files, Video files, Doc files etc...We also allow user to access all of this content (Web and the linked files) in offline mode by downloading all the required files. Once all the files are available locally, we'd like the web view to use these local files even when the user is online.
You can achieve this by subclassing the AFHTTPSessionManager
. Here you can check if the client is offline. And then you can change the cache policy or force the app to use cached data.
if (![[AFNetworkReachabilityManager sharedManager] isReachable]) {
[request setCachePolicy:NSURLRequestReturnCacheDataElseLoad];
}