使用CocoaPods作为“图表”框架。 Swift 2 [英] Using CocoaPods for the "Charts" framework. Swift 2

查看:140
本文介绍了使用CocoaPods作为“图表”框架。 Swift 2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新手当谈到CocoaPods所以请与我一起承担!
我在看教程(



2。

  pod设置--verbose 

并获得以下输出:





3。

  Podfile 

,并得到以下结果:





4。



取消注释use_frameworks!和未注释的platform:ios,'6.0'并将其更改为platform:ios,'9.0'



现在我被困,我需要使用的图表框架的依赖。如果这是一个非常简单的答案,请抱歉。



感谢您的帮助:)



安装pod文件我拖动'Charts.xcodeproj文件到我的项目。



当我尝试和嵌入二进制文件时,我有多种选择:





当我添加他们和构建我得到以下错误:



解决方案

Hey First您必须决定要使用哪个图表库。
这样的东西 https://github.com/danielgindi/ios-charts



对于上面的图表库你必须使用

  



现在您的pod文件将是这样的

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

pod'Charts'

现在打开终端并转到您的项目目录并输入命令

  pod install 

你很好去。
希望这有助于你。


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:

2.

pod setup --verbose

and got the following output:

3.

open -a Xcode Podfile

and got the following result :

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!

Thanks in advanced for your help :)

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:

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

解决方案

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.

这篇关于使用CocoaPods作为“图表”框架。 Swift 2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆