About This Title

Pages: 517
Published: February 2021
ISBN: 9781944994020
In Print

A Combine Kickstart

Introducing the Declarative Framework for Processing Values over Time

by Daniel H Steinberg

Combine is about to replace all those techniques for asynchronously passing information around in an iOS or macOS App: Target-Action, callbacks, closures, delegates, notifications… all of them.

This hands-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.


This work was written and produced entirely by the author. We are proud to be distributing it.

eBook Formats:

  • PDF for desktop/tablets

  • epub for Apple Books, e-readers

  • mobi for Kindle readers

Get all eBook formats here for $30.00 (USD)

Add to Cart we accept visa, mastercard, amex, discover, paypal


In your typical iOS or Mac app, the controller sees the view and the model and can send them messages directly. But how do they communicate back?

We have decades of experience using all sorts of devices. They all work fine but they all work differently.

The Combine framework unifies these different modes of communication into a single pattern. In fact, Apple has wrapped traditional methods like Notification, Timers, URLSession, and even KVO in Combine publishers so that they can participate as well.

We start with a UIKit example and transition to SwiftUI so that you can see that no matter which framework you are using for your user interface, the time is right for Combine. You’ll quickly understand the four pillars of Combine: publishers, subscribers, subscriptions, and operators and start building out pipelines that connect far away sources.

This code-along book is filled with examples that covers a myriad of use cases while providing you with the mental model to apply these techniques to your own projects.

What You Need

You need a Mac running Xcode 13 or higher.

Source code, Errata, Typos, Suggestions

Resources

Releases:

  • P1.2 2021/11/16
  • P1.1 2021/08/30
  • P1.0 2021/02/07

Contents & Extracts

  • Copyright and Legal
    • Copyright
    • Book Version
    • Code Download
    • Recommended Settings
    • Submit Errata
    • Official Links
    • Legal
  • 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
    • Async Await
    • 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…

Author

Daniel H Steinberg is the author of more than a dozen books including the best selling books A SwiftUI Kickstart, A Swift Kickstart, Second Edition A Functional Programming Kickstart and Dear Elena. He has written apps for the iPhone and the iPad since the SDKs first appeared and has written programs for the Mac all the way back to System 7.

Daniel presents iOS, Functional Programming, SwiftUI, and Swift training and consults through his company Dim Sum Thinking. When he’s not coding or talking about coding for the Mac, the iPhone, and the iPad he’s probably cooking, baking bread, or hanging out with friends. Details on his training and speaking are on the Dim Sum Thinking website.

eBook Formats:

  • PDF for desktop/tablets

  • epub for Apple Books, e-readers

  • mobi for Kindle readers

Get all eBook formats here for $30.00 (USD)

Add to Cart we accept visa, mastercard, amex, discover, paypal

Related Titles:

About This Title

Pages: 517
Published: February 2021
ISBN: 9781944994020
Edition: 1
In Print