Publishes the number of elements received from the upstream publisher.
SDKs
- iOS 13.0+
- macOS 10.15+
- Mac Catalyst 13.0+
- tvOS 13.0+
- watchOS 6.0+
- Xcode 11.0+
Framework
- Combine
Declaration
func count() -> Publishers.Count<Deferred<DeferredPublisher>>
Return Value
A publisher that consumes all elements until the upstream publisher finishes, then emits a single value with the total number of elements received.