Reputation: 375
Since iOS 9 has been released, i would like to provide to the user the possibility to stick with iOS 8 or just use the latest version of the SDK.
It's easy to create a double branch on git, but how do i handle this choice in CocoaPods? How do i let the user choose what version of the SDK to download, even if i'm constantly updating and expanding either the iOS 8 and the iOS 9 one?
Probably the only way to let the user choose is to complete the iOS 8 version and only after that, start releasing the iOS 9 one, abandoning the other. I hope i'm not right.
Thanks in advance.
Upvotes: 0
Views: 345
Reputation: 7252
You can specify which version of a cocoa pod you want to use in your project inside the pod file.
Besides no version, or a specific one, it is also possible to use logical operators:
'> 0.1' Any version higher than 0.1 '>= 0.1' Version 0.1 and any higher version '< 0.1' Any version lower than 0.1 '<= 0.1' Version 0.1 and any lower version In addition to the logic operators CocoaPods has an optimistic operator ~>:
'~> 0.1.2' Version 0.1.2 and the versions up to 0.2, not including 0.2 and higher '~> 0.1' Version 0.1 and the versions up to 1.0, not including 1.0 and higher '~> 0' Version 0 and higher, this is basically the same as not having it.
So lets say your iOS 8 supported SDK is v1.0.0 and your iOS 9 supported SDK is v2.0.0.
You should be able to make updates to either SDK and just increment the minor version numbers for each when these are released, and if your users have their pod file setup correctly (for iOS 8 ONLY use ~> 2.0.0
and iOS 9 ONLY use >= 2.0.0
), they shouldn't have anything to worry about.
Upvotes: 1