Publishers.Last
// Publishers.Last Publisher
Publishers
.Last(upstream: Publishers.Sequence<[Int], Never>(sequence: [1, 2, 3, 4, 5]))
.sink(receiveCompletion: { completion in
switch completion {
case .failure:
print("Combine Last Error")
case .finished:
print("Combine Last Finish")
}
}, receiveValue: { value in
print("Combine Last : \(value)")
})
.store(in: &cancellables)
// last Operator
Publishers.Sequence<[Int], Never>(sequence: [1, 2, 3, 4, 5])
.last()
.sink(receiveCompletion: { completion in
switch completion {
case .failure:
print("Combine Last Error")
case .finished:
print("Combine Last Finish")
}
}, receiveValue: { value in
print("Combine Last : \(value)")
})
.store(in: &cancellables)
// Combine Last : 5
// Combine Last FinishRxSwift
ReactiveSwift
μ°Έκ³
Last updated