0Pricing
SwiftUI Academy · Lesson

Transforming with map & filter

Reshape values as they flow downstream.

Operators Reshape Streams

Between a publisher and its subscriber you can insert operators that transform values as they flow downstream.

map Transforms Each Value

The map operator runs a closure on every value and emits the result, changing the stream's shape.

[1, 2, 3].publisher
    .map { $0 * 10 }

All lessons in this course

  1. Publishers & Subscribers
  2. Transforming with map & filter
  3. Debounce for Live Search
  4. Bridging Combine into SwiftUI
← Back to SwiftUI Academy