

GitHub - ReactiveCocoa/ReactiveSwift: Streams of values over time
source link: https://github.com/ReactiveCocoa/ReactiveSwift
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

README.md
Streams of values over time. Tailored for Swift.
?Getting Started ?Release Roadmap
What is ReactiveSwift?
ReactiveSwift offers composable, declarative and flexible primitives that are built around the grand concept of streams of values over time.
These primitives can be used to uniformly represent common Cocoa and generic programming patterns that are fundamentally an act of observation, e.g. delegate pattern, callback closures, notifications, control actions, responder chain events, futures/promises and key-value observing (KVO).
Because all of these different mechanisms can be represented in the same way, it’s easy to declaratively compose them together, with less spaghetti code and state to bridge the gap.
Getting Started
-
An overview of the semantics and example use cases of the ReactiveSwift primitives, including
Signal
,SignalProducer
,Property
andAction
. -
An overview of the operators provided to compose and transform streams of values.
-
Building on top of ReactiveSwift, ReactiveCocoa extends Cocoa platform frameworks with reactive bindings and extensions.
-
How does ReactiveSwift relate to RxSwift?
An overview of how ReactiveSwift differs from RxSwift for Swift idiomaticity.
Examples
-
Interactive Form UI
ReactiveSwift includes a UI Examples playground, which demonstrates:
- how to build an interactive form UI with bindings, properties and
Action
s, with a live view in action. - how to use reactive primitives to implement the Model-View-ViewModel architectural pattern, with the View Model being the source of truth for the View.
- how to build an interactive form UI with bindings, properties and
Advanced Topics
-
Bindings and reactive extensions for Cocoa and Cocoa Touch frameworks are offered separately as ReactiveCocoa.
-
Contracts of the ReactiveSwift primitives, Best Practices with ReactiveSwift, and Guidelines on implementing custom operators.
Installation
ReactiveSwift supports macOS 10.9+, iOS 8.0+, watchOS 2.0+, tvOS 9.0+ and Linux.
Carthage
If you use Carthage to manage your dependencies, simply add
ReactiveSwift to your Cartfile
:
github "ReactiveCocoa/ReactiveSwift" ~> 3.0
If you use Carthage to build your dependencies, make sure you have added ReactiveSwift.framework
, and Result.framework
to the "Linked Frameworks and Libraries" section of your target, and have included them in your Carthage framework copying build phase.
CocoaPods
If you use CocoaPods to manage your dependencies, simply add
ReactiveSwift to your Podfile
:
pod 'ReactiveSwift', '~> 3.0'
Swift Package Manager
If you use Swift Package Manager, simply add ReactiveSwift as a dependency
of your package in Package.swift
:
.Package(url: "https://github.com/ReactiveCocoa/ReactiveSwift.git", majorVersion: 3)
Git submodule
- Add the ReactiveSwift repository as a submodule of your application’s repository.
- Run
git submodule update --init --recursive
from within the ReactiveCocoa folder. - Drag and drop
ReactiveSwift.xcodeproj
andCarthage/Checkouts/Result/Result.xcodeproj
into your application’s Xcode project or workspace. - On the “General” tab of your application target’s settings, add
ReactiveSwift.framework
, andResult.framework
to the “Embedded Binaries” section. - If your application target does not contain Swift code at all, you should also
set the
EMBEDDED_CONTENT_CONTAINS_SWIFT
build setting to “Yes”.
Playground
We also provide a great Playground, so you can get used to ReactiveCocoa's operators. In order to start using it:
- Clone the ReactiveSwift repository.
- Retrieve the project dependencies using one of the following terminal commands from the ReactiveSwift project root directory:
git submodule update --init --recursive
OR, if you have Carthage installedcarthage checkout
- Open
ReactiveSwift.xcworkspace
- Build
Result-Mac
scheme - Build
ReactiveSwift-macOS
scheme - Finally open the
ReactiveSwift.playground
- Choose
View > Show Debug Area
Have a question?
If you need any help, please visit our GitHub issues or Stack Overflow. Feel free to file an issue if you do not manage to find any solution from the archives.
Release Roadmap
Plan of Record
ABI stability release
ReactiveSwift is expected to declare library ABI stability when Swift rolls out resilence support. Until then, ReactiveSwift would incrementally adopt new language features that help move towards to goal. The ETA is Swift 5.
Recommend
-
85
README.md Reactive extensions to...
-
21
-
28
对于使用MVC的小伙伴来说,随着业务的增多,代码会显得越来越臃肿。本人也是如此感觉,于是学习ReactiveCocoa来进行MVVM+RAC架构。
-
37
README.md
-
43
目录 MVVM 架构 介绍 ReactiveCocoa 1 .RACSignal 2 .RACSubject 3 . RACReplaySubjec 4 . RACMulticastConnection...
-
7
之前分析过 RACSignal,数据流向是单向而且是1对1的,如果想使用双向绑定的效果,可以使用 ReactiveCocoa 框架中提供的 RACChannel;接来下分析 RACChannel 底层的实现原理。 我们以一个例子开始分析,比如将视图控制器中的 UITextField text 属性和...
-
10
RACScheduler ReactiveCocoa 框架中的调度器,ReactiveCocoa 中的信号可以在 RACScheduler 上执行任务、发送结果; RACScheduler 的实现主要是基于 GCD 封装,提供了 GCD 不具备的特性。 RACScheduler 有 4...
-
10
在项目中,经常会把用户操作动作和业务操作进行绑定,比如点击登录按钮会进行登录网络请求、点击下载图片等等。ReactiveCocoa 中提供捆绑副作用和信号的 RACCommand,开发者可以利用 RACCommand 来实现类似这种 动作-响应 绑定的功能。 RACCommand...
-
7
ReactiveCocoa是Github开源的一款cocoa FRP 框架,我在
-
15
ReactiveCocoa与Functional Reactive Programming 2013-06-19 什么是Functional Reactive Programming Functional Reactive Programming(以下简称FRP)是一种响应变化的编程范式。先来看一小段代码
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK