UIWebView存在在AFNetworking,導致APP store不通過~~~~~
唉唉網上好多方案都不適合我!!!哭嘁嘁
我只寫適合我的吧,參考參考就好啦
解決方案的基本思想就是 remove掉關於所有這個UIWebView的文件
(1)vim Podfile
abstract_target 'BasePods' do
pod 'AFNetworking', '=2.5.4'
# remove UIKit(UIWebView) rejected by AppStore
pre_install do |installer|
puts 'pre_install begin....'
dir_af = File.join(installer.sandbox.pod_dir('AFNetworking'), 'UIKit+AFNetworking')
Dir.foreach(dir_af) {|x|
real_path = File.join(dir_af, x)
if (!File.directory?(real_path) && File.exists?(real_path))
if((x.start_with?('UIWebView') || x == 'UIKit+AFNetworking.h'))
File.delete(real_path)
puts 'delete:'+ x
end
end
}
puts 'end pre_install.'
end
end
最重點就是;
# remove UIKit(UIWebView) rejected by AppStore
pre_install do |installer|
puts 'pre_install begin....'
dir_af = File.join(installer.sandbox.pod_dir('AFNetworking'), 'UIKit+AFNetworking')
Dir.foreach(dir_af) {|x|
real_path = File.join(dir_af, x)
if (!File.directory?(real_path) && File.exists?(real_path))
if((x.start_with?('UIWebView') || x == 'UIKit+AFNetworking.h'))
File.delete(real_path)
puts 'delete:'+ x
end
end
}
puts 'end pre_install.'
end
這段腳本吧
(2)pod install
Analyzing dependencies
Downloading dependencies
pre_install begin....
delete:UIWebView+AFNetworking.h
delete:UIKit+AFNetworking.h
delete:UIWebView+AFNetworking.m
end pre_install.
Generating Pods project
Integrating client project
Pod installation complete! There are 11 dependencies from the Podfile and 13 total pods installed.
看到結果是不是很完美,哈哈哈哈哈哈~~~~