ReactiveSwift v4.0.0 Release Notes

Release Date: 2018-07-17 // almost 6 years ago
  • ๐Ÿš€ This is the first release of ReactiveSwift 4.0. It requires Swift 4.1 or above.

    ๐Ÿ‘ Xcode 10 Support

    ๐Ÿ‘ 1. Swift 4.2 and Xcode 10 support (#644, kudos to @ikesyo)

    Operators

    1. New method collect(every:on:skipEmpty:discardWhenCompleted:) which delivers all values that occurred during a time interval (#619, kudos to @Qata) ๐Ÿšฆ 2. debounce now offers an opt-in behaviour to preserve the pending value when the signal or producer completes. You may enable it by specifying discardWhenCompleted as false (#287, kudos to @Qata)
    2. New property operator: filter (#586, kudos to @iv-mexx) ๐Ÿ”€ 4. New operator merge(with:) (#600, kudos to @ra1028)
    3. New operator map(value:) (#601, kudos to @ra1028) ๐Ÿšฆ 6. SignalProducer.merge(with:), SignalProducer.concat, SignalProducer.prefix, SignalProducer.then, SignalProducer.and, SignalProducer.or, SignalProducer.zip(with:), SignalProducer.sample(with:), SignalProducer.sample(on:), SignalProducer.take(until:), SignalProducer.take(untilReplacement:), SignalProducer.skip(until:), SignalProducer.flatMap, SignalProducer.flatMapError, SignalProducer.combineLatest(with:), Signal.flatMap, Signal.flatMapError, Signal.withLatest(from:) and Property.init(initial:then:) now accept SignalProducerConvertible conforming types (#610, #611, kudos to @ra1028)

    ๐Ÿ”„ Changes: <~ Bindings

    <~ bindings now works with optional left-hand-side operands. (#642, kudos to @andersio and @Ankit-Aggarwal)

    let nilTarget: BindingTarget\<Int\>? = nil// This is now a valid binding. Previously required manual// unwrapping in ReactiveSwift 3.x.nilTarget \<~ notifications.map { $0.count }
    

    ๐Ÿ”„ Changes: Conditional Conformance

    ๐Ÿšฆ 1. For Swift 4.1 and above, BindingSource conformances are required to have Error parameterized as exactly NoError. As a result, Signal and SignalProducer are now conditionally BindingSource. (#590, kudos to @NachoSoto and @andersio) ๐Ÿšฆ 2. For Swift 4.1 and above, Signal.Event and ActionError are now conditionally Equatable. (#590, kudos to @NachoSoto and @andersio)

    Interoperability

    ๐Ÿšฆ 1. Result now interoperates with SignalProducer n-ary operators as a constant producer (#606, kudos to @Qata)

    Miscellaneous

    1. When unfair locks from libplatform are unavailable, ReactiveSwift now fallbacks to error checking Pthread mutexes instead of the default. Mitigations regarding issues with pthread_mutex_trylock have also been applied. (#654, kudos to @andersio)
    2. Lifetime may now be manually ended using Lifetime.Token.dispose(), in addition to the existing when-token-deinitializes semantic. (#641, kudos to @andersio)
    3. Bag may now be initialised with a sequence of elements. (#609, kudos to @ra1028)
    4. Non-class types may now conform to ReactiveExtensionProvider. (#636, kudos to @ra1028) ๐Ÿ“š 5. Fix some documentation errors about Carthage usage (#655)
    5. [CocoaPods] CocoaPods 1.4.0 is the minimum required version. (#651, kudos to @ikesyo)