With Swift classes, you can abstract certain classes and functions from their inner implementation through access controls. In Combine, these are called type erasures, and in this video, get guided through what type erasures are, and how you can leverage them in your code.
- [Instructor] When you design classes and structs, … in Swift, perhaps as a Swift Package SDK, … you want to let others consume it, … certain methods and properties you make public, … whereas others you may not want to make public and expose … your inner workings, and you set those to private. … We're going to spend a brief moment talking … about Type Erasures in Combine, … and how they help you Abstract your Implementation. … Combine has an equivalent notion of implementation access, … called Type Erasures, … they enable you to design your Publishers … so that you don't have to overexpose its inner workings. … Now let's look at some code. … In our Exercise File, option click on Publisher. … Here you can see what type it discloses, Publisher Decode, … Publishers Map, URLSession, data Task Publisher, … as well as Array Post and JSONDecoder quite detailed. … As you can see, it is a Data Task Publisher, … and we're decoding a JSON and outputting … an Array of type posts. … Now go to line 25, and we're going to add .eraseToAnyPublisher. …
- 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.