Combine:
Asynchronous Programming
with Swift
By Scott Gardner, Shai Mishali,
Florent Pillet & Marin Todorov
Combine: Asynchronous Programming with Swift
By Scott Gardner, Shai Mishali, Florent Pillet & Marin Todorov
Copyright 2020 Razeware LLC.
Notice of Rights
All rights reserved. No part of this book or corresponding materials (such as text, images, or source code) may be reproduced or distributed by any means without prior written permission of the copyright owner.
Notice of Liability
This book and all corresponding materials (such as source code) are provided on an as is basis, without warranty of any kind, express of implied, including but not limited to the warranties of merchantability, fitness for a particular purpose, and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in action of contract, tort or otherwise, arising from, out of or in connection with the software or the use of other dealing in the software.
Trademarks
All trademarks and registered trademarks appearing in this book are the property of their own respective owners.
Dedications
"For Jenn and Charlotte"
Scott Gardner
"For my wife Elia and Baby Ethanmy love, inspiration, and rock . To my family and friends for their support: Dad, Mom, Ziv, Adam, and everyone else, youre the best!"
Shai Mishali
"To Fabienne and Alexandra ."
Florent Pillet
"To my father. To my mom. To Mirjam and our beautiful daughter."
Marin Todorov
About the Authors
Scott Gardner is an author and the technical editor for this book. Scott is a veteran iOS app architect and developer with over ten years of experience. He's authored several books, video courses, tutorials, and articles on Swift and iOS app development, with a focus on reactive programming. Additionally, Scott is an Apple Certified Trainer for Swift and iOS, and he also enjoys speaking at conferences, meetups, and online events. Say hello to Scott on Twitter at @scotteg, or connect with him on LinkedIn at scotteg.com.
Shai Mishali is an author and the final pass editor on this book. He's the iOS Tech Lead for Gett, the global on-demand mobility company; as well as an international speaker, and a highly active open-source contributor and maintainer on several high-profile projects - namely, the RxSwift Community and RxSwift projects, but also releases many open-source endeavors around Combine such as CombineCocoa, RxCombine and more. As an avid enthusiast of hackathons, Shai took 1st place at BattleHack Tel-Aviv 2014, BattleHack World Finals San Jose 2014, and Ford's Developer Challenge Tel-Aviv 2015. You can find him on GitHub and Twitter as @freak4pc.
Florent Pillet is an author of this book. He has been developing for mobile platforms since the last century and moved to iOS on day 1. He adopted reactive programming before Swift was announced, using it in production since 2015. A freelance developer, Florent also uses reactive programming on the server side as well as on Android and likes working on tools for developers like the popular NSLogger when he's not contracting, training or reviewing code for clients worldwide. Say hello to Florent on Twitter and GitHub at @fpillet.
Marin Todorov is an author of this book. Marin is one of the founding members of the raywenderlich.com team and has worked on eight of the teams books. He's an independent contractor and has worked for clients like Roche, Realm, and others. Besides crafting code, Marin also enjoys blogging, teaching and speaking at conferences. He happily open-sources code. You can find out more about Marin at www.underplot.com.
About the Artist
Vicki Wenderlich is the designer and artist of the cover of this book. She is Rays wife and business partner. She is a digital artist who creates illustrations, game art and a lot of other art or design work for the tutorials and books on raywenderlich.com. When shes not making art, she loves hiking, a good glass of wine and attempting to create the perfect cheese plate.
Book License
By purchasing Combine: Asynchronous Programming with Swift, you have the following license:
You are allowed to use and/or modify the source code in Combine: Asynchronous Programming with Swift in as many apps as you want, with no attribution required.
You are allowed to use and/or modify all art, images and designs that are included in Combine: Asynchronous Programming with Swift in as many apps as you want, but must include this attribution line somewhere inside your app: Artwork/images/designs: from Combine: Asynchronous Programming with Swift, available at www.raywenderlich.com.
The source code included in Combine: Asynchronous Programming with Swift is for your personal use only. You are NOT allowed to distribute or sell the source code in Combine: Asynchronous Programming with Swift without prior authorization.
This book is for your personal use only. You are NOT allowed to sell this book without prior authorization, or distribute it to friends, coworkers or students; they would need to purchase their own copies.
All materials provided with this book are provided on an as is basis, without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action or contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the software.
All trademarks and registered trademarks appearing in this guide are the properties of their respective owners.
Before You Begin
This section tells you a few things you need to know before you get started, such as what youll need for hardware and software, where to find the project files for this book, and more.
What You Need
To follow along with this book, youll need the following:
A Mac running macOS Catalina (10.15) or later. Earlier versions might work, but they're untested.
Xcode 12 or later. Xcode is the main development tool for iOS. Youll need Xcode 12 or later for the tasks in this book. Since Combine was introduced with the iOS 13 SDK, Xcode 11 might work as well - but the code in this book was tested against Xcode 12. You can download the latest version of Xcode from Apples developer site here: apple.co/2asi58y
Next page