Logo for tanaschita.com

A visual cheat sheet of Combine operators

A diagram-based reference for common Combine publisher operators.

26 Jan 2026 · 5 min read

This article provides a visual cheat sheet of common Combine operators, with a diagram for each one to illustrate how values flow through a pipeline. The diagrams focus on the most commonly used operators.

Sponsorship logo
Architecture & Design Patterns for iOS
This book is a practical guide to essential architectural principles and design patterns for iOS development. It covers strategies for building maintainable apps with Swift and SwiftUI, including dependency injection, navigation, common patterns, and modularization.
LEARN MORE

Note: The diagrams below are generated using SwiftUI. If you're interested in how they are built, you can find the source code on GitHub.

allSatisfy(_:)

Publishes true if all elements match the condition. Publishes false & completes if it receives an element that does not match the condition.

Combine operator

append(_:)

Appends the specified elements after the upstream publisher completes.

Combine operator

collect(_:)

Collects up to the specified number of elements and emits them in an array.

Combine operator

combineLatest(_:)

Publishes a tuple of the most recent element from multiple publishers when any of them emits a value.

Combine operator

compactMap(_:)

Transforms each element with the provided closure and publishes any returned non-nil optional result.

Combine operator

contains(_:)

Publishes true & completes after receiving a matching value, or false when upstream publisher completes without producing a matching value.

Combine operator

count()

Publishes the count of all received elements when the upstream publisher completes.

Combine operator

dropFirst(_:)

Omits a specified number of elements, then republishes all remaining elements.

Combine operator

drop(while:)

Omits elements until a given closure returns false, then republishes all remaining elements.

Combine operator

filter(_:)

Republishes all elements that match a provided closure.

Combine operator

first()

Publishes the first element of the upstream publisher, then completes.

Combine operator

first(where:)

Publishes the first element of a stream that satisfies a condition, then completes.

Combine operator

flatMap(maxPublishers:_:)

Transforms all elements from an upstream publisher into a new publisher.

Combine operator

ignoreOutput()

Ignores all elements and passes along only the upstream publisher's completion state.

Combine operator

last()

Publishes the last element of the upstream publisher after it completes.

Combine operator

last(where:)

Publishes the last element that satisfies a condition after the upstream publisher completes.

Combine operator

map(_:)

Transforms each element it receives from the upstream publisher with the provided closure.

Combine operator

max()

Publishes the maximum value received after the upstream publisher completes.

Combine operator

merge(with:)

Publishes an element whenever any of the upstream publishers emits an element.

Combine operator

min()

Publishes the minimum value received after the upstream publisher completes.

Combine operator

output(at:)

Republishes an element specified by its position, or completes if upstream publisher completes before the specified element.

Combine operator

output(in:)

Republishes elements specified by a range of positions.

Combine operator

prefix(_:)

Republishes elements up to a specified maximum count.

Combine operator

prefix(while:)

Emits values while elements meet the specified condition, otherwise it completes.

Combine operator

prepend(_:)

Prepends elements with the specified values.

Combine operator

reduce(_:_:)

Applies a closure to all elements and publishes a final result when the upstream publisher completes.

Combine operator

removeDuplicates()

Publishes an element only if it doesn't match the previous element.

Combine operator

replaceNil(with:)

Replaces nil elements with the provided element.

Combine operator

scan(_:_:)

Transforms elements by applying a closure that receives its previous return value and the next element from the upstream publisher.

Combine operator

switchToLatest()

Republishes elements sent by the most recently received publisher.

Combine operator

zip(_:)

Waits until both publishers emit an element, then publishes the oldest unconsumed element from each one as a tuple.

Combine operator
Download cheat sheet as pdf
Sponsorship logo
Preparing for a technical iOS job interview
Preparing for a technical iOS Job Interview with over 300 questions & answers. Covering Swift & Objective-C, SwiftUI & UIKit, Combine, HTTP Networking, iOS File System, Core Data, Concurrency with async/await, Security, Automated Testing, Dependency Management, AI & Machine Learning and more.
LEARN MORE
Sponsorship logo
Architecture & Design Patterns for iOS
This book is a practical guide to essential architectural principles and design patterns for iOS development. It covers strategies for building maintainable apps with Swift and SwiftUI, including dependency injection, navigation, common patterns, and modularization.
LEARN MORE
Sponsorship logo
Become a sponsor of tanaschita.com
By publishing an article on different iOS topics every week, tanaschita.com is constantly growing in the developer community and may provide a great audience for you as a sponsor.
CLICK TO LEARN MORE

Newsletter

Image of a reading marmot
Subscribe

Like to support my work?

Say hi

Related tags

Articles with related topics

combine

reactive programming

swift

Memory management in Combine

Understand how retain cycles appear and when they turn into memory leaks in Combine.

12 Jan 2026 · 5 min read

Latest articles and tips

© 2026 tanaschita.com

Privacy policy

Impressum