This release is meant for use with Xcode 7.3.x and Swift 2.2.x. See v4.0.1 for Swift 2.1 support.
Swift
Added
ActionTypeprotocol for extendingActions (#2828, thanks @ikesyo and @cradnovich!)Signal.sampleWith()/SignalProducer.sampleWith(), which behaves likesampleOn()but includes the value from the sampler (#2792, thanks @victorlin!)PropertyType.map()for transforming properties (#2788, thanks @sdduursma and @filblue!)- A Swift playground demonstrating ReactiveCocoa (#2795, #2850, #2930, #2943, thanks @RuiAAPeres, @iv-mexx, and @tomj!)
Signal.logEvents()/SignalProducer.logEvents()for debugging (#2839, #2895, #2897, thanks @RuiAAPeres and @ikesyo!)- Count- and predicate–based variants of
Signal.collect()andSignalProducer.collect()(#2835, thanks @dmcrodrigues!) - A convenience initializer to
CompositeDisposablethat takes aSequenceTypeofDisposable?s (#2806, thanks @larryonoff!) Signal.uniqueValues()/SignalProducer.uniqueValues()(#2884, thanks @mdiep and @nixterrimus!)- Overloads for
flatMap()andflatten()forSignals andSignalProducers withNoError(#2885, thanks @mdiep, @NachoSoto, and @andymatuschak!) +=variant for CompositeDisposable and ActionDisposable (#2920, thanks @ikesyo!)SignalProducer.init(values: Value...)(#2928, thanks @larryonoff!)SignalProducer.self.merge()(#2925, #2931, thanks @larryonoff and @ikesyo!)SignalProducer.prefix(value:)andSignalProducer.prefix()for providing initial values (#2941 #2954, thanks @inamiy and @RuiAAPeres!)SignalProducer.concat(value:)for concatenating a value (#2954, thanks @RuiAAPeres!)
Improved
SignalProducer.replayLazily()no longer usesNSObject(#2811, thanks @ikesyo!)NSNotificationCenter.rac_notifications()will now interrupt if the object deallocates before the producer starts (#2859, thanks @ikesyo and @andymatuschak!)<~will now automatically bridge values to Objective-C (#2551, thanks @sharplet!)
Fixed
- Memory leak in
SignalProducer.lift(), which is used internally in many operators (#2800, thanks @ikesyo and @trifonov-ivan!) - Recursive observation of
MutablePropertys (#2764, thanks @andersio and @olegshnitko!) - Replace uses of spinlocks because they’re not safe on some devices (#2670, thanks @Adlai-Holler!)
- Potential deadlock in
SignalProducer.buffer()(#2900, thanks @mdiep!) SignalProducer.replayLazily()won’t interrupt while there are active subscriptions (#2903, thanks @mdiep!)- Retain cycle with
Action.unsafeCocoaAction(#2910, thanks @mdiep!) UISchedulernow delivers events on the main queue (#2912, thanks @ikesyo!)
Objective-C
Added
Improved
RACCommandnow specifies that itsInputTypeis contravariant (#2696, thanks @erichoracek!)
Fixed
- Behavior of
-[RACSequence foldRightWithStart:reduce:](#2777, thanks @ikesyo!) - Memory leak in
-[UIControl rac_signalForControlEvents:](#2797, thanks @vagase!) - Memory leak in
RACSubject(#2845, thanks @ikesyo and @tzongw!) - Retaining of signals in
-[RACSignal bind:], which underpins most operators (#2935, thanks @tzongw!)