iosswiftchartscocoapodsios-charts

Using CocoaPods for the "Charts" framework. Swift 2


I am a newbie when it comes to CocoaPods so please bear with me! I am looking at the tutorial (https://www.raywenderlich.com/97014/use-cocoapods-with-swift) however this is using the dependency "pod 'Alamofire', '2.0.2'". I have looked online for over a hour now and I can't find what to use for the Charts framework (https://cocoapods.org/?q=charts).

So Far i have done the following steps:

1.

sudo gem install cocoapods 

and got the following output:

enter image description here

2.

pod setup --verbose

and got the following output:

enter image description here

3.

open -a Xcode Podfile

and got the following result :

enter image description here

4.

Uncommented "use_frameworks!" and uncommented "platform :ios, '6.0'" and changed it to "platform :ios, '9.0'"

Now i am stuck as i don't know what dependancies i need to use for the charts framework. Apologies if this is a very simple answer!

EDIT: After installing the pod files i dragged the 'Charts.xcodeproj file into my project.

When i try and embed binaries i have various options:

enter image description here

When i add them and build i get the following errors:

enter image description here


Solution

  • Hey First you have to decide which chart library You want to use. Something like this https://github.com/danielgindi/ios-charts

    for above chart library you have to use

    pod 'Charts'
    

    in your pod file inside the project .

    Now your pod file will be something like this

    source 'https://github.com/CocoaPods/Specs.git'
    platform :ios, '8.0'
    use_frameworks!
    
    pod 'Charts'
    

    Now open the terminal and go to your project directory and enter the command

    pod install
    

    and you are good to go. Hope this help you.