react-native-charts-wrapper IOS集成

按照官网来
1.去github下载包,chart要3.03的
2.复制文件夹到IOS目录下


E0CED802-3B41-4FB4-9096-9EB06F58FC99.png

3.引入Libraries
4.在General -> Embedded Binarles 引入 Charts.framework / Swifty.framework


8E3727EA-AE41-4138-BE10-F0E4804734AE.png

5.把node_modules/react-native-charts-wrapper/ios/ReactNativeCharts拉到IOS目录 选create group,要确认ReactNativeCharts里面有文件
3EDF9421-3B17-4263-9A89-F4AEDD298006.png
DDE03071-FFEF-4A36-BE11-0DAB15601F37.png
  1. 创建XXXX-Bridging-Header.h,然后把内容改为
#import "React/RCTBridge.h"
#import "React/RCTViewManager.h"
#import "React/RCTUIManager.h"
#import "React/UIView+React.h"
#import "React/RCTBridgeModule.h"
#import "React/RCTEventDispatcher.h"
#import "React/RCTEventEmitter.h"

7.set ForBeginner-Bridging-Header.h in Build Settings -> Swift Compiler - General -> Object-C Bridging Header //如果ReactNativeCharts里面没有Swift文件,那就不会显示有Swift选项
8.set No in Build Settings -> Swift Compiler - Version -> User Legacy Swift Language Version //我的是3.3

https://github.com/wuxudong/react-native-charts-wrapper/tree/master/Example
IOS上遇到的错误

image

解决:https://www.jianshu.com/p/b8041caa9947

D5E949D3-4B41-4F34-ABB7-ECF92D036280.png

降低Chart版本 3.03

你可能感兴趣的:(react-native-charts-wrapper IOS集成)