用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的路径

相关文章

react 中的高阶组件主要是对于 hooks 之前的类组件来说的,如...
我们上一节了解了组件的更新机制,但是只是停留在表层上,例...
我们上一节了解了 react 的虚拟 dom 的格式,如何把虚拟 dom...
react 本身提供了克隆组件的方法,但是平时开发中可能很少使...
mobx 是一个简单可扩展的状态管理库,中文官网链接。小编在接...
我们在平常的开发中不可避免的会有很多列表渲染逻辑,在 pc ...