123
votes

I'm trying add add a pod by cocoapods, and I am using swift 3, while the pod(SQlite.swift).

I am trying to use doesn't have a master of the latest swift version, however there is a branch for swift 3.

So how should I set my podfile to download the specific branch? Is it possible?

Here is my 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
2

2 Answers

270
votes

The podfile guide mentions the following syntax:

To use a different branch of the repo:

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

So in your case, that would be:

pod 'SQLite.swift', :git => 'https://github.com/stephencelis/SQLite.swift.git', :branch => 'swift3-mariotaku'
6
votes

If you just want to use the main branch (master), write the following command:

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

But if you want to use an alternative/different branch, this one is for you:

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

Easy peasy! 😊