Frage

I have a bunch of manual RACSubject properties in a particular view model; I am calling sendNext at certain points in the code, and I want new subscribers to these signals to immediately have their subscribeNext block be called with the latest value in that signal. Is this possible?

As an example, if I am sending the values 1 -> 12 -> 42 and then down the line there's a new subscriber, I want that subscriber to get 42 straight off (and then obviously listen for more pushes when they come about).

War es hilfreich?

Lösung

OK so it looks like I wanted to be using the RACSubject subclass RACReplaySubject instead. Not sure how I missed that one!

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top