You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Lessons/Combine-Pt.3/README.md
+35-1Lines changed: 35 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -61,11 +61,41 @@ Declarative UI updates from user input.
61
61
62
62
<!-- > -->
63
63
64
+
## Networking
65
+
66
+
**URLSession** has a Combine publisher: `dataTaskPublisher`
67
+
68
+
The result is a tuple `(Data, URLResponse)`
69
+
70
+
And there's also support with **Codable** by using the operator `decode(type:decoder:)`
71
+
72
+
[Playground Sample Code]()
73
+
74
+
<asideclass="notes">
75
+
When using this combination, we need to first use map on the result from dataTaskPublisher, to just get the Data part of it from the tuple. Then we can apply the operator to decode it.
0 commit comments