Skip to content

Commit 2363499

Browse files
committed
Edit L13
1 parent d27200c commit 2363499

File tree

3 files changed

+79
-38
lines changed

3 files changed

+79
-38
lines changed

Lessons/Combine Pt.3/README.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
<!-- Run this slideshow via the following command: -->
2+
<!-- reveal-md README.md -w -->
3+
4+
5+
<!-- .slide: class="header" -->
6+
7+
# Combine
8+
9+
## [Slides](https://make-school-courses.github.io/MOB-2.4-Advanced-Architectural-Patterns-in-iOS/Slides/Combine-Pt.2/README.html ':ignore')
10+
11+
<!-- > -->
12+
13+
## Learning Objectives
14+
15+
By the end of this lesson, you will be able to:
16+
17+
**Implement**:
18+
- Combine to update UI with UIKit
19+
- Combine to fetch and display data
20+
21+
<!-- > -->
22+
23+
## @Published
24+
25+
A type that publishes a property marked with an attribute.
26+
27+
```swift
28+
@propertyWrapper struct Published<Value>
29+
```
30+
- Publishing a property with the `@Published` attribute creates a publisher of this type.
31+
- You access the publisher with the $ operator
32+
- Class constrained
33+
34+
[Docs](https://developer.apple.com/documentation/combine/published)
35+
36+
<!-- v -->
37+
38+
```swift
39+
class Weather {
40+
...
41+
@Published var temperature : Int!
42+
...
43+
let _ = $temperature
44+
.sink() { value in
45+
print ("Temperature now: \(value)")
46+
}
47+
}
48+
```
49+
50+
<!-- v -->
51+
52+
## Integration with UIKIt
53+
54+
Declarative UI updates from user input.
55+
56+
<!-- > -->
57+
58+
## Integration with Networking
59+
60+
Fetching, transforming and displaying data.
61+
62+
<!-- > -->
63+
64+
## After Class
65+
66+
Combine is a new framework and it will take more reading and practice to get used to it. But you can start using what you already know, little by little. 😉
67+
68+
69+
<!-- > -->
70+
71+
## Additional Resources
72+
73+
- [Using Combine](https://heckj.github.io/swiftui-notes/#coreconcepts-publisher-subscriber)
74+
- Book: Practical Combine by Donny Walls
75+
- Book: Combine - Asynchronous programming with Swift By Shai Mishali, Marin Todorov, Florent Pillet and Scott Gardner
76+

Lessons/Combine-Pt.2/README.md

Lines changed: 2 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ By the end of this lesson, you will be able to:
1616

1717
**Describe**:
1818
- Subjects
19+
- Back pressure
1920

2021
**Implement**:
2122
- Subscriptions with operators
22-
- Combine in an Xcode project to update UI
2323

2424
<!-- > -->
2525

@@ -268,42 +268,7 @@ movies
268268

269269
## In-Class Activity
270270

271-
In pairs, solve the two given challenges in Operators.playground
272-
273-
<!-- > -->
274-
275-
## @Published
276-
277-
A type that publishes a property marked with an attribute.
278-
279-
```swift
280-
@propertyWrapper struct Published<Value>
281-
```
282-
- Publishing a property with the `@Published` attribute creates a publisher of this type.
283-
- You access the publisher with the $ operator
284-
- Class constrained
285-
286-
[Docs](https://developer.apple.com/documentation/combine/published)
287-
288-
<!-- v -->
289-
290-
```swift
291-
class Weather {
292-
...
293-
@Published var temperature : Int!
294-
...
295-
let _ = $temperature
296-
.sink() { value in
297-
print ("Temperature now: \(value)")
298-
}
299-
}
300-
```
301-
302-
<!-- v -->
303-
304-
## Integration with UIKIt
305-
306-
Declarative UI updates from user input.
271+
Challenges in Operators.playground
307272

308273
<!-- > -->
309274

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Students by the end of the course will be able to ...
4242
| 8 | Mon, Feb 15 | [Functional Programming Pt.2] |
4343
| 9 | Wed, Feb 17 | Lab - Sharing Progress |
4444
| 10 | Mon, Feb 22 | [Combine Pt.1] |
45-
| 11 | Wed, Feb 24 | Combine Pt.2 |
45+
| 11 | Wed, Feb 24 | [Combine Pt.2] |
4646
| 12 | Mon, Mar 1 | Combine Pt.3 & Review |
4747
| 13 | Wed, Mar 3 | Final Exam |
4848

0 commit comments

Comments
 (0)