Releases: ReactiveCocoa/ReactiveSwift
1.1.5
1.1.4
2.0.0 Release Candidate 2
This is the second release candidate of ReactiveSwift 2.0. It targets Swift 3.1 with preliminary support of Swift 3.2 and Swift 4.0.
Bugfix
- Fixed a deadlock upon disposal when combining operators, i.e. zip and combineLatest, are used. (#471, kudos to @stevebrambilla for catching the bug)
2.0.0 Release Candidate 1
This is the first release candidate of ReactiveSwift 2.0. It targets Swift 3.1 with preliminary support of Swift 3.2 and Swift 4.0.
Changes
-
If the input observer of a
Signal
deinitializes while theSignal
has not yet terminated, aninterrupted
event would now be automatically sent. (#463, kudos to @andersio) -
ValidationResult
andValidatorOutput
have been renamed toValidatingProperty.Result
andValidatingProperty.Decision
, respectively. (#443) -
Mitigated a race condition related to ARC in the
Signal
internal. (#456, kudos to @andersio)
Addition
2.0.0 alpha 3
This is the third alpha release of ReactiveSwift 2.0. It targets Swift 3.1 with preliminary support of Swift 3.2 and Swift 4.0.
Bugfixes
- Fixed an impedance mismatch in the
Signal
internals that caused heap corruptions. (#449, kudos to @gparker42)
Additions
-
combinePrevious
forSignal
andSignalProducer
no longer requires an initial value. The first tuple would be emitted as soon as the second value is received by the operator if no initial value is given. (#445, kudos to @andersio) -
In Swift 3.2 or later, you may create
BindingTarget
for a key path of a specific object. (#440, kudos to @andersio)
2.0.0 alpha 2: Producing Productive Producers.
This is the second alpha release of ReactiveSwift 2.0. It targets Swift 3.1 with preliminary support of Swift 3.2 and Swift 4.0.
Highlights
-
The performance of
SignalProducer
has been improved significantly. (#140, kudos to @andersio)All lifted
SignalProducer
operators no longer yield an extraSignal
. As a result, the calling overhead of event delivery is generally reduced proportionally to the level of chaining of lifted operators. -
When composing
Signal
andSignalProducer
of inhabitable types, e.g.Never
orNoError
,ReactiveSwift now warns about operators that are illogical to use, and traps at runtime when such operators attempt to instantiate an instance. (#429, kudos to @andersio)
Changes
-
interrupted
now respectsobserve(on:)
. (#140)When a produced
Signal
is interrupted, ifobserve(on:)
is the last applied operator,interrupted
would now be delivered on theScheduler
passed toobserve(on:)
just like other events. -
Feedbacks from
isExecuting
to the state of the sameAction
, including allenabledIf
convenience initializers, no longer deadlocks. (#400, kudos to @andersio) -
MutableProperty
now enforces exclusivity of access. (#419, kudos to @andersio)In other words, nested modification in
MutableProperty.modify
is now prohibited. Generally speaking, it should have extremely limited impact as in most cases theMutableProperty
would have been deadlocked already.
Additions
-
New operator:
promoteValue
. (#429) -
promoteError
can now infer the new error type from the context. (#413, kudos to @andersio) -
In Swift 3.2 or later, you can use
map()
with the new Smart Key Paths. (#435, kudos to @sharplet) -
N-ary
SignalProducer
operators are now generic and accept any type that can be expressed asSignalProducer
. (#410, kudos to @andersio)Types may conform to
SignalProducerConvertible
to be an eligible operand.
2.0.0 alpha 1
This is the first alpha release of ReactiveSwift 2.0. It requires Swift 3.1 (Xcode 8.3).
Changes
Modified Signal
lifetime semantics (#355)
The Signal
lifetime semantics is modified to improve interoperability with memory debugging tools. ReactiveSwift 2.0 adopted a new Signal
internal which does not exploit deliberate retain cycles that consequentially confuse memory debugging tools.
A Signal
is now automatically and silently disposed of, when:
- the
Signal
is not retained and has no active observer; or - (New) both the
Signal
and its input observer are not retained.
It is expected that memory debugging tools would no longer report irrelevant negative leaks that were once caused by the ReactiveSwift internals.
SignalProducer
resource management (#334)
SignalProducer
now uses Lifetime
for resource management. You may observe the Lifetime
for the disposal of the produced Signal
.
let producer = SignalProducer<Int, NoError> { observer, lifetime in
if let disposable = numbers.observe(observer) {
lifetime.observeEnded(disposable.dispose)
}
}
Two Disposable
-accepting methods Lifetime.Type.+=
and Lifetime.add
are provided to aid migration, and are subject to removal in a future release.
Signal and SignalProducer
-
All
Signal
andSignalProducer
operators now belongs to the respective concrete types. (#304)Custom operators should extend the concrete types directly.
SignalProtocol
andSignalProducerProtocol
should be used only for constraining associated types. -
combineLatest
andzip
are optimised to have a constant overhead regardless of arity, mitigating the possibility of stack overflow. (#345) -
flatMap(_:transform:)
is renamed toflatMap(_:_:)
. (#339) -
promoteErrors(_:)
is renamed topromoteError(_:)
. (#408) -
Event
is renamed toSignal.Event
. (#376) -
Observer
is renamed toSignal.Observer
. (#376)
Action
Action(input:_:)
,Action(_:)
,Action(enabledIf:_:)
andAction(state:enabledIf:_:)
are renamed toAction(state:execute:)
,Action(execute:)
,Action(enabledIf:execute:)
andAction(state:enabledIf:execute:)
respectively. (#325)
Properties
- The memory overhead of property composition has been considerably reduced. (#340)
Bindings
-
The
BindingSource
now requires only a producer representation ofself
. (#359) -
The
<~
operator overloads are now provided byBindingTargetProvider
. (#359)
Disposables
-
SimpleDisposable
andActionDisposable
has been folded intoAnyDisposable
. (#412) -
CompositeDisposable.DisposableHandle
is replaced byDisposable?
. (#363) -
The
+=
operator overloads forCompositeDisposable
are now hosted inside the concrete types. (#412)
Bag
Schedulers
Scheduler
gains a class bound. (#333)
Lifetime
Lifetime.ended
now uses the inhabitableNever
as its value type. (#392)
Atomic
Signal
andAtomic
now useos_unfair_lock
when it is available. (#342)
Additions
-
FlattenStrategy.race
is introduced. (#233, kudos to @inamiy)race
flattens whichever inner signal that first sends an event, and ignores the rest. -
FlattenStrategy.concurrent
is introduced. (#298, kudos to @andersio)concurrent
starts and flattens inner signals according to the specified concurrency limit. If an inner signal is received after the limit is reached, it would be queued and drained later as the in-flight inner signals terminate. -
New operators:
reduce(into:)
andscan(into:)
. (#365, kudos to @ikesyo)These variants pass to the closure an
inout
reference to the accumulator, which helps the performance when a large value type is used, e.g. collection. -
Property(initial:then:)
gains overloads that accept a producer or signal of the wrapped value type when the value type is anOptional
. (#396)
Deprecations and Removals
-
The requirement
BindingSource.observe(_:during:)
and the implementations have been removed. -
All Swift 2 (ReactiveCocoa 4) obsolete symbols have been removed.
-
All deprecated methods and protocols in ReactiveSwift 1.1.x are no longer available.
Acknowledgement
Thank you to all of @ReactiveCocoa/reactiveswift and all our contributors, but especially to @andersio, @calebd, @eimantas, @ikesyo, @inamiy, @Marcocanc, @mdiep, @NachoSoto, @sharplet and @tjnet. ReactiveSwift is only possible due to the many hours of work that these individuals have volunteered. ❤️
1.1.3
This is a maintanence release of ReactiveSwift 1.1. It is compatible with Swift 3.0 and Swift 3.1.
Deprecation
observe(_:during:)
is now deprecated. It would be removed in ReactiveSwift 2.0.
Usetake(during:)
and the relevant observation API ofSignal
,SignalProducer
andProperty
instead. (#374)