67

GitHub - ReactiveCocoa/ReactiveSwift: Streams of values over time

 6 years ago
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.
neoserver,ios ssh client

README.md

ReactiveSwift

Streams of values over time. Tailored for Swift.

Latest ReactiveSwift Documentation Join the ReactiveSwift Slack community.


Carthage compatible CocoaPods compatible SwiftPM compatible GitHub release Swift 4.0 platforms

?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

  1. Core Reactive Primitives

    An overview of the semantics and example use cases of the ReactiveSwift primitives, including Signal, SignalProducer, Property and Action.

  2. Basic Operators

    An overview of the operators provided to compose and transform streams of values.

  3. ReactiveCocoa

    Building on top of ReactiveSwift, ReactiveCocoa extends Cocoa platform frameworks with reactive bindings and extensions.

    GitHub releaseCarthage compatible CocoaPods compatible

  4. How does ReactiveSwift relate to RxSwift?

    An overview of how ReactiveSwift differs from RxSwift for Swift idiomaticity.

Examples

  1. Interactive Form UI

    ReactiveSwift includes a UI Examples playground, which demonstrates:

    • how to build an interactive form UI with bindings, properties and Actions, 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.
  2. Online Searching

Advanced Topics

  1. ReactiveCocoa

    Bindings and reactive extensions for Cocoa and Cocoa Touch frameworks are offered separately as ReactiveCocoa.

  2. API Reference

  3. API Contracts

    Contracts of the ReactiveSwift primitives, Best Practices with ReactiveSwift, and Guidelines on implementing custom operators.

  4. Debugging Techniques

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

  1. Add the ReactiveSwift repository as a submodule of your application’s repository.
  2. Run git submodule update --init --recursive from within the ReactiveCocoa folder.
  3. Drag and drop ReactiveSwift.xcodeproj and Carthage/Checkouts/Result/Result.xcodeproj into your application’s Xcode project or workspace.
  4. On the “General” tab of your application target’s settings, add ReactiveSwift.framework, and Result.framework to the “Embedded Binaries” section.
  5. 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:

  1. Clone the ReactiveSwift repository.
  2. 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 installed
    • carthage checkout
  3. Open ReactiveSwift.xcworkspace
  4. Build Result-Mac scheme
  5. Build ReactiveSwift-macOS scheme
  6. Finally open the ReactiveSwift.playground
  7. 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

Current Stable Release:
GitHub release

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
    • www.cocoachina.com 7 years ago
    • Cache

    ReactiveCocoa小结

  • 28
    • www.cocoachina.com 6 years ago
    • Cache

    ReactiveCocoa的使用

    对于使用MVC的小伙伴来说,随着业务的增多,代码会显得越来越臃肿。本人也是如此感觉,于是学习ReactiveCocoa来进行MVVM+RAC架构。

  • 37

    README.md

  • 43
    • www.cocoachina.com 6 years ago
    • Cache

    iOS 之ReactiveCocoa

    目录 MVVM 架构 介绍 ReactiveCocoa 1 .RACSignal 2 .RACSubject 3 . RACReplaySubjec 4 . RACMulticastConnection...

  • 7
    • chipengliu.github.io 4 years ago
    • Cache

    ReactiveCocoa-RACChannel

    之前分析过 RACSignal,数据流向是单向而且是1对1的,如果想使用双向绑定的效果,可以使用 ReactiveCocoa 框架中提供的 RACChannel;接来下分析 RACChannel 底层的实现原理。 我们以一个例子开始分析,比如将视图控制器中的 UITextField text 属性和...

  • 10
    • chipengliu.github.io 4 years ago
    • Cache

    ReactiveCocoa-RACScheduler底层实现分析

    RACScheduler ReactiveCocoa 框架中的调度器,ReactiveCocoa 中的信号可以在 RACScheduler 上执行任务、发送结果; RACScheduler 的实现主要是基于 GCD 封装,提供了 GCD 不具备的特性。 RACScheduler 有 4...

  • 10
    • chipengliu.github.io 4 years ago
    • Cache

    ReactiveCocoa-RACCommand原理分析

    在项目中,经常会把用户操作动作和业务操作进行绑定,比如点击登录按钮会进行登录网络请求、点击下载图片等等。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