O'Reilly logo

Swift Functional Programming - Second Edition by Dr. Fatih Nayebi

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Signals

Signals are event streams that send values over time that are already in progress. We can imagine them as pipes that send values without knowing about the previous values they have sent or future values they are going to send. Signals can be composed, combined, and chained declaratively.

Signals can unify all Cocoa common patterns for asynchrony and event handling:

  • Delegate methods
  • Callback blocks
  • Notifications
  • Control actions and responder chain events
  • Future and promises
  • Key-value observing

As all of these mechanisms can be represented in the same way, it is easy to declaratively chain and combine them together.

ReactiveSwift represents signals as Signal. Signals can be used to represent notifications, user input, and so on. As ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required