上架裏面使用了UIWebView怎麼處理

如題:上架裏面使用了UIWebView怎麼處理

1、全局搜索一下UIWebView,本身建的文件中UIWebView的改爲WKWebView(簡單)

2、UIWebView存在在AFNetworking

 辦法:remove掉關於全部這個UIWebView的文件ios

# line to define a global platform for your project
# platform :ios, '8.0'

source 'https://github.com/CocoaPods/Specs.git'

target ‘SneakerIndex’ do
  pod 'AFNetworking', '~> 3.0'
  pod 'YYModel'
  # 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

target ‘SneakerIndexTests' do
end

3、檢測項目中是否包含其餘的UIWebView

 1.打開終端,cd + 把項目的工程文件所在文件夾拖入終端(即 獲得項目的工程文件所在的路徑)git

 2.輸入如下命令(注意最後有個點號,並且點號和 UIWebView 之間必須有一個空格):github

grep -r UIWebView .

 3.以上操做都正確的話,會立刻出現工程中帶有 UIWebView 的文件的列表(包括在工程中沒法搜索到的 .a 文件中對UIWebView 的引用)spa

總結:以上3步基本能夠解決關於UIWebView的問題了,拜了個拜

相關文章
相關標籤/搜索