Code Monkey home page Code Monkey logo

reactivecocoa_use's Introduction

ReactiveCocoa_Use

  • 对于使用MVC的小伙伴来说,随着业务的增多,代码会显得越来越臃肿。
  • 本人也是如此感觉,于是学习ReactiveCocoa来进行MVVM+RAC架构。
  • 对于ReactiveCocoa的使用,本人会不定时更新。
  • 如果帮助到了各位看官,希望给个星星和Star。

ReactiveCocoa的使用.png

RACSignal常用操作.png


什么是函数响应式编程?

  • 满足函数式的一些特性
  • 面向离散事件流
  • 流散事件流操作

函数式编程的特性?

  • 闭包&高阶函数
  • 惰性计算
  • 不改变状态
  • 递归

什么是ReactiveCocoa?

  • Github mac客户端副产物
  • FRP在Cocoa框架下的实现
  • 富含了Cocoa框架多种组件
  • 提供基于时间变化的数据流的组合和变化
  • 简称RAC

如何理解基于时间变化的数据流?


#ReactiveCocoa基础知识

核心组件

  • RACSteam、 RACSequence、 RACSignal
  • RACSubscriber
  • RACDisposable
  • RACScheduler
  • Cocoa框架适配工具

① RACSteam

RACSteam的两个子类:

  • RACSequence:基于空间的数据流,在时间上是连续的。操作多,消耗高
  • RACSignal:基于时间的数据流,在时间上是离散的。

RACSteam.png

RACSequence VS RACSignal

  • Pull-driver vs Push-driver (看书&看电视)
  • Data vs Event
  • 其他差异

② Signal Subscirber Disposable

Signal Subscirber Disposable

③ RACScheduler

  • 用来做调度
  • 代替GCD
  • 异步与并发

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.