Search code examples
reactive-swift

ReactiveSwift. Zipping an array of signal producers


I have an array of signal producers that fetch similar objects from the backend like [SignalProducer<Object, NSError>]. How can I zip them to have array of their results [Object] every time they all are finished? I know there zip operators with predefined number of producers, but it is not a case, as the number of requests to send is known only in runtime.


Solution

  • SignalProducer has a static zip function that accepts a sequence of producers.