Search code examples
iosxcodeswiftmacososx-yosemite

Using Swift2.0 pods in Xcode 6.4


I have a Mac with OSX Yosemite installed on it. Due to some reasons I am not able to update it to El Capitan. Thus I am stucked with XCode 6.4 to develop apps for iOS.

I am using CocoaPods to work on my apps. Most of the pods which I want to use have been updated to work with Swift 2.0 and XCode 7+. Is there any way I can use those pods to work on XCode 6.4 /Swift 1.2

Note:
For those who are suggesting me to upgrade giving various reasons, I am already aware of them. I should not use Swift 1.2, but that's the limitation, hence the question. I am not able to upgrade because I don't have authorisation to do that. Most of our apps needs to be tested on iOS7 too, which has no support in El Capitan. Now don't suggest me to upgrade to iOS9. I can't because these are enterprise apps and that is not my decision.


Solution

  • You can restrict your pod file pods to fetch specific versions of libraries which support swift 1.2. Read release notes for each library you have in your pod file to find out specific version which works with swift 1.2.

    This is how you can restrict pod library to specific version: pod 'SwiftyJSON', '~> 2.1.0'

    But I would strongly recommend to find a way to update Xcode to latest release version. Xcode 7 has lots of improvements and bug fixes. You will enjoy using it.