CocoaPods 更新慢&swift版本适配

一、更新慢的问题

使用CocoaPods来添加第三方类库,无论是执行pod install还是pod update都卡在了Analyzing dependencies不动

原因在于当执行以上两个命令的时候会升级CocoaPods的spec仓库,加一个参数可以省略这一步,然后速度就会提升不少。

加参数的命令如下:

pod install --verbose --no-repo-update

pod update --verbose --no-repo-update

二、我在swift工程用CocoaPods导入第三方的时候,会有提示版本与你当前使用swift版本不匹配的问题

在Podfile中加上这段话可以限制导入的第三方类库的语言版本

post_install do |installer|

    installer.pods_project.targets.each do |target|

        target.build_configurations.each do |config|

            config.build_settings['SWIFT_VERSION'] = '2.3'

        end

    end

end

原文地址:https://www.cnblogs.com/Walking-Jin/p/6289312.html