134

我正在尝试通过 cocoapods 添加一个 pod,我使用的是 swift 3,而 pod( SQlite.swift)。

我正在尝试使用没有最新 swift 版本的大师,但是 swift 3 有一个分支

那么我应该如何设置我的 podfile 来下载特定的分支呢?可能吗?

这是我的播客文件:

platform :ios, '10.0'

target 'RedShirt' do
  use_frameworks!

  # Pods for RedShirt
   pod 'SQLite.swift', :git => 'https://github.com/stephencelis/SQLite.swift.git'
end

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['SWIFT_VERSION'] = '3.0'
    end
  end
end
4

2 回答 2

291

podfile指南提到了以下语法:

要使用 repo 的不同分支:

pod 'Alamofire', :git => 'https://github.com/Alamofire/Alamofire.git', :branch => 'dev'
                                                                             ^^^
                                                                   (the space is important)

所以在你的情况下,那将是:

pod 'SQLite.swift', :git => 'https://github.com/stephencelis/SQLite.swift.git', :branch => 'swift3-mariotaku'
于 2016-10-08T09:24:54.277 回答
10

如果只想使用主分支(master),写如下命令:

pod "SAConfettiView", :git => 'https://github.com/oskarko/SAConfettiView.git'

但是如果你想使用一个替代/不同的分支,这个是给你的:

pod "SAConfettiView", :git => 'https://github.com/oskarko/SAConfettiView.git', :branch => 'develop'

十分简单!

于 2020-07-29T12:24:27.120 回答