This is part of the "iOS Data and Networking" learning path. View Path

Reactive Programming in iOS with Combine

Feb 4 2021 · Video Course (2 hrs, 52 mins) · Beginner

Learn how to manage asynchronous work in iOS the reactive way: using Combine! Master the techniques and best practices to write declarative Combine code in playgrounds and complete iOS app projects.

5/5 3 Ratings

Version

  • Swift 5.3, macOS 11.0, Xcode 12.2

Getting Started

Introduction

7:17 Free

Welcome to the course! Find out a bit about the history of reactive programming, and a high level overview of Combine.

1

Learn about Publishers and Subscribers, which are the endpoints of the Combine pipeline, and how they work with one another.

2

Learn about some built in operators for Subscribers as well as Subjects, which help connect the imperative and declarative world.

3

In this hands-on challenge, use your knowledge of publishers and subscribers to create a blackjack dealer.

4

Conclusion

1:19

Recap what you learned about publishers and subscribers, and gear up for the rest of the course.

5

Transforming & Filtering Operators

Learn about what Operators are in Combine, and get an overview of which ones you’ll learn about in this part of the course.

6

Collect, map, replaceNil and replaceEmpty are basic operators that can be used to transform data into another form.

7

Learn about how the scan and flatMap operators can be used in your code to do more advanced transformations.

8

In this hands-on challenge use your knowledge of transforming operators to lookup a phone number in a contact book.

9

Basic filtering operators like filter, removeDuplicates, ignoreOutput and compactMap can be used to narrow down which values get sent downstream to subscribers.

10

Learn about more filtering operators: first(where:), last(where:), drop, and prefix, which give you additional ways to keep values from traveling downstream.

11

In this challenge, use your knowledge of filtering operators to slim down an array of numbers to a predefined set of values.

12

Conclusion

0:36

Review what you’ve learned about transforming and filtering operators.

13

Combining Operators

You’ve learned about several operators already, but there’s more! In this part, you’ll learn about combining operators.

14

Prepend

9:21

Discover the prepend family of operators, which consists of prepend(Output), prepend(Sequence), and prepend(Publisher).

15

Append

8:21

Now check out the append family of operators, which consists of append(Output), append(Sequence), and append(Publisher).

16

In this hands-on challenge, turn your old-school 7 digit phone number into a modern day number using combining operators.

17

Learn how you can use operators such as switchToLatest, merge(with:), combineLatest and zip to perform more advanced combinations of data from publisher.

18

In this episode, see examples of switchToLatest, merge(with:), combineLatest and zip in a Swift playground.

19

In this hands-on challenge, build upon the last challenge to interleave multiple arrays of data together.

20

Conclusion

0:47

Let’s recap the different combining operators you learned about in this part of the course.

21

Timing, Scheduling and Sequencing Operators

Learn about the final set of operators we’ll cover: timing, scheduling and sequencing operators.

22

The basic timing operators like delay and collect do just what they advertise - delay values from a publisher and collect a series of emitted values.

23

The debounce and throttle operators come in handy when collecting data such as a person typing, keeping you from checking after every keystroke.

24

Learn how the timeout operators can be used to cause a publisher to time out and complete, and measureInterval to measure the interval between emissions.

25

In this hands-on challenge, use your knowledge of timing operators to decode a message from a set of mysterious data.

26

Learn about the schedule and receive operators, which can be used to tell Combine which Scheduler to use when running the operations.

27

Sequencing operators such as max, min, count and output can give you information on the sequence of emitted values as a whole.

28

Challenge time! Use your knowledge of sequence operators to give a golfer a report on their golf game.

29

Conclusion

2:07

Congrats on finishing the course! Review what you’ve learned and find out where you can go to learn more about Combine.

30

Who is this for?

iOS developers who have some experience or who have worked their way through the previous courses in the iOS and Swift for Beginners learning path.

No previous reactive programming experience needed — we’ve got you covered!

Covered concepts

  • Reactive Programming
  • Combine Basics
  • Publishers
  • Subscribers
  • Transforming Operators: Collect, map, replaceNil and more
  • Filtering Operators: filter, removeDuplicates, ignoreOutput and more
  • Combining Operators: prepend, append and more
  • Timing Operators
  • Scheduling Operators
  • Sequencing Operators

Contributors

Comments