1.0.0
ReactiveSwift 1.0 🎉
This is the first major release of ReactiveSwift, a multi-platform, pure-Swift functional reactive programming library spun off from ReactiveCocoa. As Swift continues to expand beyond Apple’s platforms, we hope that ReactiveSwift will see broader adoption. To learn more, please refer to ReactiveCocoa’s CHANGELOG.
Major changes since ReactiveCocoa 4 include:
-
Updated for Swift 3
APIs have been updated and renamed to adhere to the Swift 3 API Design Guidelines.
-
Signal Lifetime Semantics
Signal
s now live and continue to emit events only while either (a) they have observers or (b) they are retained. This clears up a number of unexpected cases and makes Signals much less dangerous. -
Reactive Proxies
Types can now declare conformance to
ReactiveExtensionsProvider
to expose areactive
property that’s generic overself
. This property hosts reactive extensions to the type, such as the ones provided onNotificationCenter
andURLSession
. -
Property Composition
Property
s can now be composed. They expose many of the familiar operators fromSignal
andSignalProducer
, includingmap
,flatMap
,combineLatest
, etc. -
Binding Primitives
BindingTargetProtocol
andBindingSourceProtocol
have been introduced to allow binding of observable instances to targets.BindingTarget
is a new concrete type that can be used to wrap a settable but non-observable property. -
Lifetime
Lifetime
is introduced to represent the lifetime of any arbitrary reference type. This can be used with the newtake(during:)
operator, but also forms part of the new binding APIs. -
Race-free Action
A new
Action
initializerAction(state:enabledIf:_:)
has been introduced. It allows the latest value of any arbitrary property to be supplied to the execution closure in addition to the input fromapply(_:)
, while having the availability being derived from the property.This eliminates a data race in ReactiveCocoa 4.x, when both the
enabledIf
predicate and the execution closure depend on an overlapping set of properties.
Extensive use of Swift’s @available
declaration has been used to ease migration from ReactiveCocoa 4. Xcode should have fix-its for almost all changes from older APIs.
Thank you to all of @ReactiveCocoa/reactiveswift and all our contributors, but especially to @andersio, @liscio, @mdiep, @NachoSoto, and @sharplet. ReactiveSwift is only possible due to the many hours of work that these individuals have volunteered. ❤️