iOS新版本提交审核,苹果给了一封邮件:
未命名22.png
UIWebView要彻底废弃,api再用就给你拒了!
如何检测项目中包含的废弃API或私有API
进入项目目录中
在终端中输入
grep -r UIWebView .
Snip20200316_5.png
所有使用了UIWebView类的文件全部显示出来
解决:
先在项目中搜了下UIWebView的使用情况,发现只有在AFNetWorking中存在UIWebView的分类
去除UIWebView分类已经不是新鲜事,git上的答案:
方法1
不指定子仓库
pod 'AFNetworking'
会拉全部子仓库, Podfile.lock文件内容如下:
PODS:
- AFNetworking (3.2.1):
- AFNetworking/NSURLSession (= 3.2.1)
- AFNetworking/Reachability (= 3.2.1)
- AFNetworking/Security (= 3.2.1)
- AFNetworking/Serialization (= 3.2.1)
- AFNetworking/UIKit (= 3.2.1)
- AFNetworking/NSURLSession (3.2.1):
- AFNetworking/Reachability
- AFNetworking/Security
- AFNetworking/Serialization
- AFNetworking/Reachability (3.2.1)
- AFNetworking/Security (3.2.1)
- AFNetworking/Serialization (3.2.1)
- AFNetworking/UIKit (3.2.1):
- AFNetworking/NSURLSession
DEPENDENCIES:
- AFNetworking
SPEC CHECKSUMS:
AFNetworking: b6f891fdfaed196b46c7a83cf209e09697b94057
PODFILE CHECKSUM: f4f26174166d90525a5a39c0240e03b41509ca01
COCOAPODS: 1.8.4
UIWebView存在于UIKit目录下,故此只需要不拉去UIKit下文件即可。
指定子仓库,语法如下:
pod 'AFNetworking/Serialization'
pod 'AFNetworking/Security'
pod 'AFNetworking/NSURLSession'
pod 'AFNetworking/Reachability'
或
pod 'AFNetworking', :subspecs => ['Serialization', 'Security', 'NSURLSession', 'Reachability'] #此处以Serialization, Security, NSURLSession为例
其它未指定的子仓库会被移除,Podfile.lock文件内容如下:
PODS:
- AFNetworking/NSURLSession (3.2.1):
- AFNetworking/Reachability
- AFNetworking/Security
- AFNetworking/Serialization
- AFNetworking/Reachability (3.2.1)
- AFNetworking/Security (3.2.1)
- AFNetworking/Serialization (3.2.1)
DEPENDENCIES:
- AFNetworking/NSURLSession
- AFNetworking/Reachability
- AFNetworking/Security
- AFNetworking/Serialization
SPEC CHECKSUMS:
AFNetworking: b6f891fdfaed196b46c7a83cf209e09697b94057
PODFILE CHECKSUM: a79757da84336da221f758fff854465c5f572851
COCOAPODS: 1.8.4
网友评论