用CocoaPods和ReactiveCocoa的安装

前端之家收集整理的这篇文章主要介绍了用CocoaPods和ReactiveCocoa的安装前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

关于用CocoaPods安装ReactiveCocoa的问题 ?

iOS 最新版 CocoaPods 的安装流程

1.移除现有Ruby默认源

$gem sources --remove https://rubygems.org/

2.使用新的源

$gem sources -a https://ruby.taobao.org/

3.验证新源是否替换成功

$gem sources -l

4.安装CocoaPods

(1)$sudo gem install -n /usr/local/bin cocoapods

(2)$pod setup

5.更新gem

$sudo gem update --system

6.新建工程,并在终端用cd指令到文件夹内

$pod searchReactiveCocoa

7.新建文件 Podfile

$vi Podfile

写入以下内容并保存 小提示:(终端vim文件 按 i 可编辑 ,esc 退出编辑,:wq 可保存退出

platform :ios,'9.0'

pod 'ReactiveCocoa'

xcodeproj '/Users/zhoupengju/Downloads/ReactivePlayground-Starter/RWReactivePlayground'

use_frameworks!


8.安装文件


$pod install


看到


Analyzing dependencies

Downloading dependencies

Installing ReactiveCocoa (4.0.1)

Installing Result (1.0.2)

Generating Pods project

Integrating client project


[!] Please close any current Xcode sessions and use `RWReactivePlayground.xcworkspace` for this project from now on.


信息就说明OK了


9.安装文件


$pod update


安装过程中碰到的问题汇总:

1. [!] Pods written in Swift can only be integrated as frameworks; this feature is still in beta. Add `use_frameworks!` to your Podfile or target to opt into using it. The Swift Pods being used are: Box,ReactiveCocoa,and Result
在Prodfile中添加 use_frameworks! 就OK了

2.
  1. Could not automatically select an Xcode project. Specify one in your Podfile like so:
  2. xcodeproj 'path/to/Project.xcodeproj'
修改xcodeproj '/Users/zhoupengju/Downloads/ReactivePlayground-Starter/RWReactivePlayground' 为当前工程Podfile的路径
原文链接:https://www.f2er.com/react/307141.html

猜你在找的React相关文章