Portal briefs are only available for synchronous updates


I have been learning functional responsive programming for nearly two months. To be honest, it’s not easy to keep up. After reading nearly 150 blog posts in two months, it’s about the same as reading a 1,000-page technical book. But with the expansion of knowledge, learning is more smooth. This article is mainly to sort out the learning routes collected by myself. It includes the idea of functional programming, ReactivecoCOA2. x(mainly objective-C part of the functional responsive programming framework), ReActivecocoA4. x(expanded Swift part of the support), RXSwift(ReactiveX series), Plus the help and influence of functional programming on the MVVM architecture.

Written in the book before

This article is not suitable for beginners, there is no code 2 years business programmers: I think I can understand, don’t have to learn to use it, because of your experience is often inadequate, after learning may feel you can manage (to god), but as the complexity of the business increase, similar to the RAC framework would bring side effects, The difficulty of debugging will make you regret it later.

Object-oriented programming is a popular approach, which means it’s easier to work together. Function response although programming is not a new topic, but the introduction of iOS project actual development will hold cautious attitude, after all, study of functional programming route is steep, that means that in the team development, need to consider how to reference, how to develop new, how to control the spread of bad to use in the project of framework.

MVC is a very mature architecture. When the business starts to be complicated, it can reasonably extract the common network request, data persistence and other related and controller coupling is not serious, which is enough to meet the daily development requirements. Differences in understanding of MVVM can also lead team members to write in radically different styles.

Say so many useless talk, is actually want to say, if you want to use in the project be careful, cautious, careful, we can learn a lot from it but we never think about that problem before, or even a whole new way of thinking, sometimes some clever implementation, will make you sigh magic to computer science, It can also be a plus when you move on.

Necessary knowledge

You need to have a clear understanding of Objective-C blocks, and since the rest of the code is implemented by Swift, I recommend that you learn Swift. (Swift makes functional programming easier to implement and understand, after all, you see that almost every blog writer has mastered, so learn it.) If you have used Swift’s higher-order functions, map, FlatMap, reduce, Filter, etc., it will be easier to understand.

Establishment of ideas

This part mainly lays the foundation of my own functional ideas, and has a new understanding of functions (closures, blocks) as first-class citizens.

This is the part that takes the longest to learn, requires more knowledge, and is the easiest to give up because you don’t know what you spent so much time learning (crap).

Stick with it, though, and you’ll get a better understanding of functional programming and just code your ideas as you learn the next ReactiveCocoa and RXSwift.

I’ll start with one of my own

  • From function calls to functional programming

This article gives you a brief overview of how to implement chained programming. Objective-c and Swift versions are included.

  • Reactive​Cocoa

NShipster gives you an idea of how Programming paradigms change with the introduction of FRP(Functional Reactive Programming) frameworks like RAC.

  • ReactiveCocoa and Functional Reactive Programming

Limboy from Mogujie explains the relationship between RAC and FRP.

  • Simple to understand – common use of iOS Reactive Cocoa

Jane read the article, from the most basic Demo start.

  • Get you started with the basics of ReactiveCocoa
  • Get you started with advanced ReactiveCocoa

Two articles are directly recommended for use here. It seems to be quite sudden, but the author thinks, Talk is cheap, show me the code.(Don’t pretend to be cruel, show me the code) The idea is to use the code to realize, this part of the content is practical, it is expected to take a week to master almost, maybe you will forget in the process of learning, it doesn’t matter. The idea building process is step-by-step, and learning the code is still a good idea building process (I don’t expect you to master RAC all the time). As for the code article, you should read it several times anyway and forget it the first time.

  • Reactive Programming primer

Before articles are functional Programming, and reactive Programming, here came across a responsive introduction to Programming ideas, highly recommended.

  • IOS Reactive Cocoa

  • ReactiveCocoa workshop

This article covers the DEBUG plug-in that comes with RAC, practices in learning RAC, and links to some technical blog posts.


In the process of learning, we may often hear some functional style nouns, such as monad, functor, etc. Here I found other good materials.

  1. Functional Swift
  2. Functor, Applicative and Monad
  3. Swift Functors, Applicatives, and Monads in Pictures English Version
  4. Functors, Applicatives, And Monads In Pictures English Version

The first book may take a long time, but this book is also the most in-depth, where you can learn more functional ideas.

ReactiveCocoa2.x

Very good RAC tutorial for beginners

  1. ReactiveCocoa Introductory Tutorial – English version of part 1
  2. ReactiveCocoa Introductory Tutorial – English version of Part 2

Blog post from Sunnyxx.

  1. Reactive Cocoa Tutorial [1] = Macros
  2. Reactive Cocoa Tutorial [2] = RACStream
  3. Reactive Cocoa Tutorial [3] = RACSignal’s Chocolate Factory
  4. Reactive Cocoa Tutorial [4] = Take only the Filters required

Learn so much to a RAC structure to share the article

  • An architectural overview of ReactiveCocoa V2.5 source code parsing

After using RAC for so long, you may hear hot and cold signals more than once, or you may not realize that something is wrong. Here’s an analysis of hot and cold signals from Meituan.

  1. RACSignal Subscription – Meituan Dianping Technology Team
  2. Cold signal and Heat Signal of ReactiveCocoa (I)
  3. Cold and heat signals of ReactiveCocoa (II) : Why is it necessary to distinguish hot and cold signals
  4. Cold signal and heat signal of ReactiveCocoa (III) : How to deal with cold signal and heat signal

In the end, Meituan’s blog post gives a method by which cold and hot signals can be converted, but it is not clear. Here is a foreign blog post to supplement it.

  • Comparing replay, replayLast, and replayLazily

An overview of RAC is added here

  • Tell me about ReactiveCocoa 2

Real RAC Project

  1. ReactiveCocoa2 of actual combat
  2. Reactivecoa, which works so well, can’t be stopped
  3. Functional responsive programming for iOS development

If you’re serious about this, and you’re making good progress, let’s take a look at the RAC source code implementation to see how this behemoth implements these amazing features.

  1. RAC core elements and signal flows
  2. Profiling @Weakify and @Strongify
  3. ReactiveCocoa source code read before the preface
  4. ReactiveCocoa RACSignal
  5. ReactiveCocoa RACSignal
  6. ReactiveCocoa bind function to read the source code
  7. ReactiveCocoa source code reading guide flatten
  8. Read the switchToLatest/combineLatestWith ReactiveCocoa source code
  9. ReactiveCocoa source code reading RACScheduler

MVVM With ReactiveCocoa

This section focuses on the performance of RAC in MVVM and how to use RAC to do the core operation of data binding in MVVM.

  1. Application of MVVM and ReactiveCocoa (Part1)
  2. MVVM Tutorial with ReactiveCocoa: Part 1/2
  3. Application of MVVM and ReactiveCocoa (Part2)
  4. MVVM Tutorial with ReactiveCocoa: Part 2/2
  5. MVVM With ReactiveCocoa

ReactiveCocoa4.x

When learning this part, I found that there was no suitable introductory course, so I tried to translate the part by myself. You can see

  1. ReactiveCocoa-Swift Part Getting Started Guide -Signal
  2. ReactiveCocoa-Swift Part Guide to Getting started -SignalProducer

A Reactive4 document translation

  1. ReactiveCocoa 4 Document translation directory

Detailed explanation of ReactiveCocoa4

  1. ReactiveCocoa 4 Diagram 1 — Event
  2. ReactiveCocoa 4 — Observer
  3. ReactiveCocoa 4 — Disposable
  4. As for the four authors did not give, it is estimated that the hole dug forgot to fill
  5. ReactiveCocoa 4 Figure 5 — Signal
  6. ReactiveCocoa 4 diagram vi — SignalProducer

RXSwift

Use the tutorial to get started

  1. RxSwift pit entry manual Part0 – basic concepts
  2. RxSwift Pit Entry Manual Part1 – Example combat

Quick Guide Series

  1. RxSwift Quick Guide (I)
  2. RxSwift Quick Guide (Ii)
  3. RxSwift Quick Guide (Iii)
  4. RxSwift Quick Guide (IV)

Quick table

At the end of this article, I put together my own RAC and RXSwift checklist, after all, no one can remember so many methods and tricks.

  • ReactiveCocoa and RXSwift

Study and communication

Here I give my iOS technology exchange group, interested in discussing technical problems friends can join the group exchange

1 group 173499350 2 group 532084214


Finally, an advertisement will be published to the public account if the owner invites my article

** Add a welcome wechat scan code to follow **Copy the code