ChenYilong / iOS12AdaptationTips

iOS12AdaptationTips
85 stars 2 forks source link

UIWebView deprecated #2

Open ChenYilong opened 6 years ago

ChenYilong commented 6 years ago

64dfd849ly1fwhz9yqu9ej20yi4eyttf 64dfd849ly1fwhza02ylyj20yi5vn4mn

itdongbaojun commented 6 years ago

https://forums.developer.apple.com/thread/109515 我们在线上环境iOS12以及以上的版本遇到了链接里面的这个问题

ChenYilong commented 5 years ago
- (void)webViewDidFinishLoad:(UIWebView *)webView {  

    NSCachedURLResponse *cachedResponse = [[NSURLCache sharedURLCache] cachedResponseForRequest:webView.request];  

}  

在iOS低版本上 正常使用NSURLCache 可以通过 cachedResponseForRequest:webView 获取到缓存的 response,但是在iOS12上 返回为 nil , 在 苹果的问题列表上也有相同的bug提问,这里记录一下

https://forums.developer.apple.com/thread/108338