How to install a pod from a specific branch?

Stanley picture Stanley · Oct 8, 2016 · Viewed 49.3k times · Source

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

Answer

VonC picture VonC · Oct 8, 2016

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'