码迷,mamicode.com
首页 > 编程语言 > 详细

react-native-Cocoapods-Swift-Project

时间:2019-01-10 18:49:01      阅读:181      评论:0      收藏:0      [点我收藏+]

标签:一个   tail   reac   sub   dev   frame   work   href   websocket   

https://blog.csdn.net/u011690583/article/details/51700662

 

1、创建一个xcode工程,single View就行,项目语言选择swift,oc的直接生成就行不用这么麻烦。
2、把跟目录上创建 node的package.json,执行命令

npm init
npm install react-native --save-dev
npm install react --save-dev
 
3、创建podfile文件,然后执行pod install ,必须第二步完成。代码如下:
 

# Uncomment the next line to define a global platform for your project
# platform :ios, ‘9.0‘

target ‘demo1‘ do
  # Comment the next line if you‘re not using Swift and don‘t want to use dynamic frameworks
  use_frameworks!

   pod ‘React‘, :path => ‘./node_modules/react-native‘, :subspecs => [
    ‘Core‘,
    ‘RCTText‘,
    ‘RCTNetwork‘,
    ‘RCTWebSocket‘
  ]
  # 如果你的RN版本 >= 0.42.0,请加入下面这行
  pod "yoga", :path => "./node_modules/react-native/ReactCommon/yoga"


end

 

 

react-native-Cocoapods-Swift-Project

标签:一个   tail   reac   sub   dev   frame   work   href   websocket   

原文地址:https://www.cnblogs.com/youhui/p/10251684.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!