Search code examples
cocoapodsalamofireswift2xcode7swifty-json

Getting non-master branch from Cocoapods?


I've been using SwiftyJSON and Alamofire in a project. Recently I downloaded XCode 7 beta. Both SwiftyJSON and Alamofire have separate, non-master branches for Swift 2. Is there a way to get these via CocoaPods, or do I need to install them in the traditional way?

I tried searching on the CocoaPods website to see if these branches had been submitted as separate Pods, but nothing came up. I'm wondering if there is a Podfile syntax that allows you to get a non-master branch.


Solution

  • You can specify any branch from the repository in your Podfile.

    Example I'm using for Alamofire:

    pod 'Alamofire', :git => 'https://github.com/Alamofire/Alamofire.git', :branch => 'swift-2.0'
    

    Change the line(s) in your Podfile then run pod install again.


    There's also this alternative syntax:

    pod 'Alamofire', git: 'https://github.com/Alamofire/Alamofire.git', branch: 'swift-2.0'