Publishers.Delay
// Publishers.Delay Publisher
Publishers.Delay(upstream: Publishers.Sequence<[Int], Never>(sequence: [1, 2, 3]), interval: .seconds(1), tolerance: .zero, scheduler: DispatchQueue.main)
.sink(receiveCompletion: { completion in
switch completion {
case .failure:
print("Combine Delay Error")
case .finished:
print("Combine Delay Finish")
}
}, receiveValue: { value in
print("Combine Delay : \(value)")
})
.store(in: &cancellables)
// delay Operator
Publishers.Sequence<[Int], Never>(sequence: [1, 2, 3])
.delay(for: .seconds(1), scheduler: DispatchQueue.main)
.sink(receiveCompletion: { completion in
switch completion {
case .failure:
print("Combine Delay Error")
case .finished:
print("Combine Delay Finish")
}
}, receiveValue: { value in
print("Combine Delay : \(value)")
})
.store(in: &cancellables)
// μΆλ ₯μ 1μ΄ νμ λ°μνλ€.
// Combine Delay : 1
// Combine Delay : 2
// Combine Delay : 3
// Combine Delay FinishRxSwift
ReactiveSwift
μ°Έκ³
Last updated