1.在工程資料夾下,增加package.json檔案,如下:
,
"dependencies":
}
$ npm install
$ pod init
2)podfile內容如下,可以根據需要新增其他subspecs
target 'rntest1' do
# uncomment this line if you're using swift or would like to
use dynamic frameworks
# use_frameworks!
# pods for rntest1
pod 'react', :path => './node_modules/react-native', :subspecs => [
'core',
'rcttext',
'rctnetwork』,
'rctwebsocket', # needed for debugging
# add any other subspecs you want to
usein your project
]end
$ pod install
4.**整合
1)在專案根目錄下建立index.ios.js檔案
2)在需要的controller中,引入rctrootview.h檔案,使用$ touch index.ios
.js
React Native 嵌入到iOS原生應用
如果你正準備從頭開始製作乙個新的應用,那麼react native會是個非常好的選擇。但如果你只想給現有的原生應用中新增一兩個檢視或是業務流程,react native也同樣不在話下。只需簡單幾步,你就可以給原有應用加上新的基於react native的特性 畫面和檢視等。把react native...
react native (五)嵌入到原生應用
今天一天算是只研究了這部分,現在把不用終端 react native init命令建立工程,直接在現有的工程上嵌入react native,現將步驟歸結如下 1.先建乙個空資料夾實際上 命名我都和現有xcode工程名相同 然後把你工程的資料夾拽入該資料夾中,並將工程資料夾改為ios 目的和官方文件上...
iOS通過openURL開啟原生應用與頁面
通過給url不同的值,可以實現呼叫系統自帶 簡訊 郵箱 瀏覽器 1 呼叫 phone 800888 800888 2 呼叫自帶 瀏覽器safari 3 呼叫 自帶mail 4 呼叫 sms 6 呼叫 ibook itms books 7 呼叫 map 8 呼叫 facetime facetime 9...