123 questions
0 votes
1 answer
250 views
os_unfair_lock_recursive_abort on Subscriber.receive(completion: .finished) in iOS 18
I have the following code for mapping ReactiveSwift SignalProducer to Combine Publisher: import Combine import Foundation import ReactiveSwift /// This is a custom Publisher that wraps SignalProducer ...
0 votes
1 answer
173 views
Protocol constraint Equatable in Swift with ReactiveSwift map function
I am using ReactiveSwift. There are two protocols: CommonProtocol and SpecificProtocol. When I use SpecificProtocol in map function there is an error Type 'any SpecificProtocol' cannot conform to '...
0 votes
1 answer
79 views
What is correct way to make a UIButton change a MutableProperty?
The following code works: import UIKit import ReactiveSwift import ReactiveCocoa class ViewController: UIViewController { let myAction = Action<UIButton, (), Never> { _ in return ...
1 vote
2 answers
144 views
How to collect values every n seconds with a max count in each interval from a signal in ReactiveSwift?
It seems like a combination of collect(every:on:skipEmpty:discardWhenCompleted:) and collect(count:) in ReactiveSwift. The resulting signal would send an event every n seconds if the count of ...
0 votes
2 answers
173 views
Reduce array of properties ReactiveSwift
I have an array of Property<Int>, and I need to reduce them to get sum of the last inputs (it's basically an unread notification counter from different SDK's) and put that into new Property<...
0 votes
0 answers
91 views
Migrating from ObjC KVO to ReactiveSwift
I'm trying to migrate some parts of a project that was initially written in Obj-C. Currently I'm trying to migrate a code that relies heavily on signals. To give you a general idea of what I'm trying ...
0 votes
1 answer
688 views
Reactive Swift Signal Producer conversion code to Combine.Publisher doesn't work with combine latest
Here's my code to convert ReactiveSwift Signal Producers to Combine.Publishers import ReactiveSwift import Combine /// convert SignalProducer<X, Never> -> Publisher<X, Never> public ...
1 vote
1 answer
229 views
How to map a completed event to an interrupt event when take(duringLifetimeOf:) happened in ReactiveSwift
For example, I want to send a request in my viewModel, if the viewModel is dealloc. The request signal should send interrupt event. This is my code func request() -> SignalProducer<Data, Error&...
1 vote
1 answer
1k views
Swift: What will happen to DispatchQueue.async call when caller viewController is deinit()
I am working on a ViewController where I called my viewModel to do a DispatchQueue.async call. After the async task starts and before the end my task ViewController is deinited by pressing the back ...
1 vote
1 answer
143 views
Why does Observer in ReactiveSwift have send method?
I feel confused when I see the sample code from ReactiveSwift, because intuitively observer is expected to receive events. Why does Observer is designed to have send(_:) method? // Signal.pipe is a ...
5 votes
2 answers
2k views
Is there a cold/hot signal in swift Combine(likes SignalProducers /Signals in ReactiveCocoa)?
I recently started using swift's Combine (I've used ReactiveCocoa before), I'm wondering if there is a concept of cold and hot signals also in Combine? Dose Publisher is equal to cold signals(...
2 votes
2 answers
330 views
ReactiveSwift one vs multiple signal subscriptions and related memory overhead
I have a simple signal, in one of the app components, that returns an array of items: var itemsSignal: Signal<[Item], Never> Those items might contain updates for the data that are rendered on ...
0 votes
1 answer
255 views
ReactiveSwift pipeline flatMap body transform not executed
I have the following pipeline setup, and for some reason I can't understand, the second flatMap is skipped: func letsDoThis() -> SignalProducer<(), MyError> { let logError: (MyError) -&...
0 votes
1 answer
304 views
ReactiveSwift error after update to Xcode12( Error msg: Cannot convert value of type 'Disposable?' to closure result type 'Void')
The following func runs well before I update to Xcode12, I'm new to ReactiveSwift and I don't know how to fix this issue, thanks for you help! Error message: Cannot convert value of type 'Disposable?'...
0 votes
1 answer
182 views
ReactiveSwift pipeline count failures after all complete
I have a pipeline in ReactiveSwift for uploads. I want to make sure that even if one of the uploads fail, the rest will not be interrupted. After all of them complete with success or failure, I should ...