Danial Kosarifa
Danial Kosarifa

Reputation: 1074

Trying to install Charts Cocoa Pods for charts version 3.0.01 and I get 3.0.5 instead why ?

I want to install the Cocoa Pods for Charts version 3.0.1 and I keep getting the 3.0.5 version.

Here is a summery of my attempt:

my PodFile :

# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'

    > target 'TestRealm-Charts' do   # Comment this line if you're not using
    > Swift and don't want to use dynamic frameworks   use_frameworks!
    > 
    >   # Pods for TestRealm-Charts   pod 'RealmSwift', '~> 2.0.2'   pod
    > 'Charts', '~> 3.0.1'
    > 
    > post_install do |installer|
    >     installer.pods_project.targets.each do |target|
    >       target.build_configurations.each do |config|
    >         config.build_settings['SWIFT_VERSION'] = '3.0'
    >       end
    >     end   end end

And after saving it I set it to be installed using the following command : pod install

But the problem is once it starts to be installed it shows that the version is Installing Charts (3.0.5)

Upvotes: 0

Views: 675

Answers (1)

Paul Beusterien
Paul Beusterien

Reputation: 29592

Change your specification from

'Charts', '~> 3.0.1'

to

'Charts', '= 3.0.1'

From the docs:

    Besides no version, or a specific one, it is also possible to use operators:

    = 0.1 Version 0.1.
    > 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.
    ~> 0.1.2 Version 0.1.2 and the versions up to 0.2, not including 0.2. 
This operator works based on the last component that you specify in your 
version requirement. The example is equal to >= 0.1.2 combined 
with < 0.2.0 and will always match the latest known version 
matching your requirements.

Upvotes: 3

Related Questions