11# Framework Overview
22
33This document contains a high-level description of the different components
4- within the ReactiveCocoa framework, and an attempt to explain how they work
4+ within the ReactiveSwift framework, and an attempt to explain how they work
55together and divide responsibilities. This is meant to be a starting point for
66learning about new modules and finding more specific documentation.
77
@@ -11,7 +11,7 @@ the [Design Guidelines][].
1111## Events
1212
1313An ** event** , represented by the [ ` Event ` ] [ Event ] type, is the formalized representation
14- of the fact that _ something has happened_ . In ReactiveCocoa , events are the centerpiece
14+ of the fact that _ something has happened_ . In ReactiveSwift , events are the centerpiece
1515of communication. An event might represent the press of a button, a piece
1616of information received from an API, the occurrence of an error, or the completion
1717of a long-running operation. In any case, something generates the events and sends them over a
@@ -20,15 +20,15 @@ of a long-running operation. In any case, something generates the events and sen
2020` Event ` is an enumerated type representing either a value or one of three
2121terminal events:
2222
23- * The ` Next ` event provides a new value from the source.
24- * The ` Failed ` event indicates that an error occurred before the signal could
23+ * The ` value ` event provides a new value from the source.
24+ * The ` failed ` event indicates that an error occurred before the signal could
2525 finish. Events are parameterized by an ` ErrorType ` , which determines the kind
2626 of failure that’s permitted to appear in the event. If a failure is not
2727 permitted, the event can use type ` NoError ` to prevent any from being
2828 provided.
29- * The ` Completed ` event indicates that the signal finished successfully, and
29+ * The ` completed ` event indicates that the signal finished successfully, and
3030 that no more values will be sent by the source.
31- * The ` Interrupted ` event indicates that the signal has terminated due to
31+ * The ` interrupted ` event indicates that the signal has terminated due to
3232 cancellation, meaning that the operation was neither successful nor
3333 unsuccessful.
3434
@@ -52,11 +52,11 @@ is no random access to values of a signal.
5252Signals can be manipulated by applying [ primitives] [ BasicOperators ] to them.
5353Typical primitives to manipulate a single signal like ` filter ` , ` map ` and
5454` reduce ` are available, as well as primitives to manipulate multiple signals
55- at once (` zip ` ). Primitives operate only on the ` Next ` events of a signal.
55+ at once (` zip ` ). Primitives operate only on the ` value ` events of a signal.
5656
57- The lifetime of a signal consists of any number of ` Next ` events, followed by
58- one terminating event, which may be any one of ` Failed ` , ` Completed ` , or
59- ` Interrupted ` (but not a combination).
57+ The lifetime of a signal consists of any number of ` value ` events, followed by
58+ one terminating event, which may be any one of ` failed ` , ` completed ` , or
59+ ` interrupted ` (but not a combination).
6060Terminating events are not included in the signal’s values—they must be
6161handled specially.
6262
@@ -100,22 +100,10 @@ using the `lift` method.
100100Furthermore, there are additional primitives that control _ when_ and _ how_ work
101101is started—for example, ` times ` .
102102
103- ### Buffers
104-
105- A ** buffer** , created by ` SignalProducer.buffer() ` , is a (optionally bounded)
106- queue for [ events] ( #events ) that replays those events when new
107- [ signals] ( #signals ) are created from the producer.
108-
109- Similar to a [ pipe] ( #pipes ) , the method returns an [ observer] ( #observers ) .
110- Events sent to this observer will be added to the queue. If the buffer is already
111- at capacity when a new value arrives, the earliest (oldest) value will be
112- dropped to make room for it.
113-
114103## Observers
115104
116105An ** observer** is anything that is waiting or capable of waiting for [ events] ( #events )
117- from a [ signal] ( #signals ) . Within RAC, an observer is represented as
118- an [ ` Observer ` ] [ Observer ] that accepts [ ` Event ` ] [ Event ] values.
106+ from a [ signal] ( #signals ) . Within RAC, an observer is represented as an [ ` Observer ` ] [ Observer ] that accepts [ ` Event ` ] [ Event ] values.
119107
120108Observers can be implicitly created by using the callback-based versions of the
121109` Signal.observe ` or ` SignalProducer.start ` methods.
@@ -131,9 +119,6 @@ clicked. Actions can also be automatically disabled based on a [property](#prope
131119disabled state can be represented in a UI by disabling any controls associated
132120with the action.
133121
134- For interaction with ` NSControl ` or ` UIControl ` , RAC provides the
135- [ ` CocoaAction ` ] [ CocoaAction ] type for bridging actions to Objective-C.
136-
137122## Properties
138123
139124A ** property** , represented by the [ ` PropertyProtocol ` ] [ Property ] ,
@@ -163,7 +148,7 @@ for memory management and cancellation.
163148When starting a [ signal producer] ( #signal-producers ) , a disposable will be returned.
164149This disposable can be used by the caller to cancel the work that has been started
165150(e.g. background processing, network requests, etc.), clean up all temporary
166- resources, then send a final ` Interrupted ` event upon the particular
151+ resources, then send a final ` interrupted ` event upon the particular
167152[ signal] ( #signals ) that was created.
168153
169154Observing a [ signal] ( #signals ) may also return a disposable. Disposing it will
@@ -174,7 +159,7 @@ For more information about cancellation, see the RAC [Design Guidelines][].
174159
175160## Schedulers
176161
177- A ** scheduler** , represented by the [ ` SchedulerType ` ] [ Scheduler ] protocol, is a
162+ A ** scheduler** , represented by the [ ` SchedulerProtocol ` ] [ Scheduler ] protocol, is a
178163serial execution queue to perform work or deliver results upon.
179164
180165[ Signals] ( #signals ) and [ signal producers] ( #signal-producers ) can be ordered to
@@ -202,6 +187,7 @@ do not allow tasks to be reordered or depend on one another.
202187[ Disposable ] : ../Sources/Disposable.swift
203188[ Scheduler ] : ../Sources/Scheduler.swift
204189[ Property ] : ../Sources/Property.swift
190+ [ MutableProperty ] : ../Sources/Property.swift#L28
205191[ Event ] : ../Sources/Event.swift
206192[ Observer ] : ../Sources/Observer.swift
207193[ BindingTarget ] : ../Sources/UnidirectionalBinding.swift
0 commit comments