美文网首页
iOS开发--通过cocoapods引入Charts框架

iOS开发--通过cocoapods引入Charts框架

作者: Bob_Running | 来源:发表于2017-05-04 18:07 被阅读0次

说明

  • 我用的xcode版本是8.1,在网上搜索了半天,都是手动引入Charts框架,并没有使用cocoapods,今天就分享一下自己通过cocoapods引入Charts框架。
  • 我通过pods搜索Charts,已经升级到: pod 'Charts', '~> 3.0.2'。该版本是用swift语言写了。

功能实现

  1. 创建OC工程,并创建一个swift文件,生成swift桥接文件,


    生成桥接文件.gif
  2. 创建Podfile文件,但需要加入:use_frameworks!
target 'Chart-Demo' do
pod 'Charts', '~> 3.0.2'
use_frameworks!
end
  1. pod install
  2. 在Chart-Demo-Bridging-Header.h中添加@import Charts;


    添加@import Charts.png
  3. OK,大功告成,我们就可以引用了。
需要引入#import "Chart-Demo-Bridging-Header.h".png
  1. 运行一下,成功。
Simulator Screen Shot 2017年5月4日 下午6.07.00.png

相关文章

网友评论

      本文标题:iOS开发--通过cocoapods引入Charts框架

      本文链接:https://www.haomeiwen.com/subject/vgrdtxtx.html