Networking with Combine and URLSession
Using URLSession.dataTaskPublisher with Combine to handle network responses.
Welcome
URLSession has built-in Combine support via `dataTaskPublisher`. Combined with `decode`, it makes type-safe networking pipelines in just a few lines.
dataTaskPublisher
```swift
URLSession.shared
.dataTaskPublisher(for: URL(string:"https://api.example.com/users")!)
.sink(receiveCompletion: { print($0) },
receiveValue: { data, response in print(data.count) })
.store(in: &cancellables)
```
All lessons in this course
- Publishers and Subscribers
- Operators: map, filter, combineLatest
- PassthroughSubject and CurrentValueSubject
- Networking with Combine and URLSession