evgenyneu / Cosmos

A star rating control for iOS/tvOS written in Swift
MIT License
2.19k stars 368 forks source link

Swift 2.3 compatible version in Cocoapods #46

Closed victorg1991 closed 8 years ago

victorg1991 commented 8 years ago

We are using this library in other library and we need to be compatible with swift 2.3, Can you please upload the latest changes of the swift2 branch to cocoapods? It would be a great help

Thank you!

Kind regards

evgenyneu commented 8 years ago

Hi @victorg1991, thank you for your request. There is a Swift 2.3 version of the library already available. One can install it with cocoapods:

pod 'Cosmos', git: 'https://github.com/marketplacer/Cosmos.git', branch: 'swift-2.3'

There is more information about other setup types for Swift 2.3 version here.

Let me know how it works for you.

victorg1991 commented 8 years ago

The problem is that you cant point to a branch in .podspec :(

evgenyneu commented 8 years ago

Oh, I see, sorry I missed that part that you were using it in a library.

I have never published two current versions of a library in CocoaPods. Can you help me with that? Currently, Cosmos on CocoaPods has tags from 1.* to 6.* which represent different versions of the library. The problem is that the Swift 2.3 is not one of them. I don't think I can use any of the current tags 1 through 6 because the users of those versions (who use optimistic version like '~> 6.0') can get the Swift 2.3 version accidentally and it will break their projects. Maybe I can create a Swift 2.3 version tag starting with zero, something like 0.0.1? Or is there a better way?

evgenyneu commented 8 years ago

Alternatively, it is possible to reference a library in podspec without a version number. For example, the podspec of Auk library references another library called "moa":

Auk.podspec:

s.dependency "moa"

In this case, it is the users of the parent library who need to specify the versions in their Podfile:

Podfile

pod 'moa', '~> 8.0'
pod 'Auk', '~> 7.0'
victorg1991 commented 8 years ago

But you could make a 1.3 version that includes swift2.3 isn't it?

The alternative is not valid in my case, I don't want to users have to specify the pod explicitily. :(

evgenyneu commented 8 years ago

Yeah, that is kind of an issue... If I release Swift 2.3 as 1.3 version, people who have '~>1.0' in their podfile, will download it. At least if I understand correctly how the optimistic operator ~> works. Here is more information about it. Let me see if I can do 0.0.1 version for you.

evgenyneu commented 8 years ago

I have uploaded the 0.0.1 version to CocoaPods containing Swift 2.3 code. Let me know if it works for you, @victorg1991.

victorg1991 commented 8 years ago

Thank you so much! :D @evgenyneu