Search code examples
swiftxcodecocoapodsswift2xcode7

Xcode 7: Force Cocoapods to compile in Swift1.2


Xcode 7 is available, but I do not wish to migrate to Swift 2.0 just yet.

I have a problem with CococaPods. They seem to be compiled in Swift 2.0 or some new Xcode features and hence not working :) As I use few pods that are almost abandoned and hardly maintained - it will take some time for me to migrate from them, or for them to migrate to Swift 2.0. How do I force Xcode 7 to compile them the old way ? :)

p.s. I did try changing Preferences > Locations > Command Line Tools to Xcode 6.4 (6E35b) but that does not seem to work.


Solution

  • Xcode 7 will only run swift 2.0. You should use either fall back to Xcode 6.4 or must upgrade to Swift 2.0.

    If you decide to shift, you can integrate older libraries them directly rather than pods for now until they support swift 2.0. Even better if you fork them out, update them to Swift 2.0 and generate a pull request for admin to merge and until them use forked ones by providing url to your github like

    pod 'Alamofire', :git => "https://github.com/yourgithubprofile/Alamofire.git"