A Combine Kickstart


Introducing the Declarative Framework for Processing Values over Time

Functional Programming Kickstart

There was a time before async/await when Combine replaced all those techniques we've used for decades for passing information around in an iOS or macOS App asynchronously: Target-Action, callbacks, closures, delegates, notifications. As much as I love Combine, it you aren't already using it in your project, you should embrace the newer language level features in async/await.

This hand-on, fast-moving kickstart introduces you to the future of declarative and reactive programming on Apple platforms. We focus on core concepts and building discrete, easy-to-understand, pieces of a pipeline that allows your app to react to changes in the state.

Updated for Xcode 12 and Swift 5.3 and tested on Apple Silicon.

Contents


Chapter 1: The Forest

Without Combine

SwiftUI

Did Set

Publishers

Subscribers

Subscriptions

Operators

Road Map

Credits, Bio, and Version History

Chapter 2: Moving Out

A Second Module

Published Value

Distance

Republishing

Assign

Understanding Operators

Making Operators

So...

Chapter 3: Sending Messages

Hiding the Model

KVO

Notifications

Subjects

Sending Nothing

Observable Objects

Custom Publisher Properties

Observables and SwiftUI

So...

Chapter 4: Not Everything Lasts Forever

Print

The Conversation

Drop and Prefix

The Kitchen Sink

Just, Empty, and Fail

Try Map

Catch

Flat Map

So...

Chapter 5: Single Streams

Dice

Timers

Stopping

Restarting and Finishing

Breakpoints

Handle Events

Timing and Duplicates

So...

Chapter 6: Multiple Streams

Share

When you've finished

Collect

Reduce and Scan

Merge

Combine Latest

Zip

Recursion

So...

Chapter 7: Very Far Away

URL

URLSession

Processing the Response

Decoding JSON

Altering the Flow

The Future

So...

Related


Training from Dim Sum Thinking

Screenshots


screenshot 1

screenshot 2

screenshot 3