In this solution, review how to create a Combine function that leverages schedulers and type erasures, to schedule and toggle a result.
(upbeat music) … - [Instructor] How did you fare? … This should be a relatively straight forward challenge, … but this is how I approached the challenge. … I used a delay operator … and set a value of three seconds on line 15. … So what I did was, I went to line 15 … and entered the following, … .delay for 2.0, scheduler. … I entered queue. … And this allows it to run on a background queue. … Next, I created a custom subscriber on line 17. … I entered final class custom subscriber. … Of type subscriber. … And that implemented the protocols required. … Starting with the aliases. … For inputs I had Int and for failure I had Never. … In addition requires certain functions to be implemented. … I entered the following, … func, receive, subscription, subscription. … And inside I set request to have unlimited. … I then created the following function. … Func, receive, input, type Int, subscribers demand. … Within that I entered the following. … Print, number, input. … And returned none. … And finally I implemented the function …
- Functional reactive programming techniques
- Transmitting data with publishers
- Consuming data with subscribers
- Publishing data
- Creating a simple Combine data stream
- Calling REST APIs
- Handling errors
- Using testing
- Managing threads with schedulers
- Throttling publisher data
- Leveraging advanced operators
Skill Level Advanced
1. Introduction to Combine
2. Combine Fundamentals
3. Work with REST APIs
4. Advanced Concepts
Go forth and code1m 31s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.