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