Skip to content

Commit 070dbf1

Browse files
author
Bob Lee
committed
Edited Source code for Ch5
1 parent dc22a4f commit 070dbf1

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

course/memory-management/@[email protected]

+1-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ bobGreet = nil // "I'm gone, bruh 🙆‍"
144144
> **Important:** a closure block with a `lazy` property is `@noescape` by default.
145145
146146
### Source Code
147-
[5004_escaping_autoclosures.playground](https://www.dropbox.com/sh/6vk04zbv1ifajc0/AABQhPhB3yYUF0qa8s8YXWdka?dl=0)
147+
[5004_escaping_autoclosures.playground](https://www.dropbox.com/sh/9qhlmvrbv4rjzum/AACq-MMUDUADBw7y-ENhpakpa?dl=0)
148148

149149
### Resources
150150
[Intro to Grand Central Dispatch in Swift 3 with Bob](https://blog.bobthedeveloper.io/intro-to-grand-central-dispatch-in-swift-3-with-bob-lee-1d4b56f731b3)

course/memory-management/automatic-reference-counting.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ myPassport = nil
177177
178178

179179
### Source Code
180-
[5001_intro_memory_management.playground](https://www.dropbox.com/sh/0ha4i5mt9j3gl3b/AABGv5IV34dTGTyk52gasckta?dl=0)
180+
[5001_intro_memory_management.playground](https://www.dropbox.com/sh/4qc6qdrq4kzaivm/AACmgT6AyZzbRev7hllsCTlua?dl=0)
181181

182182
### Resources
183183
[Make Memory Management Great Again](https://blog.bobthedeveloper.io/make-memory-management-great-again-f781fb29cea1)

course/memory-management/closure_retain_cycle.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ Based on the definition of `unowned`, it must have a non-`nil` reference to the
203203
> If `self` will never be deallocated before the closure block, use `unowned`. If you try to access the value of an unowned reference after that instance has been deallocated, you’ll get a runtime error.
204204
205205
### Source Code
206-
[5003_closure_retention_cycle.playground](https://www.dropbox.com/sh/qjxei16os00pqdh/AAD7SKIBxStQ4AzUwR6X0T4ba?dl=0)
206+
[5003_closure_retention_cycle.playground](https://www.dropbox.com/sh/ycalimxbtuvh0xv/AADTrjDqnG0BOP64TejvaiEca?dl=0)
207207

208208
### Resources
209209
[Swift Retention Cycle in Closures and Delegate](https://blog.bobthedeveloper.io/swift-retention-cycle-in-closures-and-delegate-836c469ef128)

course/memory-management/delegate_retain_cycle.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ Notice that the `SendingVC` object also has been deallocated since it no longer
9999
- Based on the rule above, the referencing object/variable must be `optional`
100100

101101
### Source Code
102-
[5002_delegate_retention_cycle.playground](https://www.dropbox.com/sh/wv9chke74n6r9du/AAD6AWxxCCdtH10674b96oIoa?dl=0)
102+
[5002_delegate_retention_cycle.playground](https://www.dropbox.com/sh/g2qi1hqrl0deevp/AADBpG8VWQkRdLd7-2REuHuTa?dl=0)
103103

104104
## Conclusion
105105
You've learned how to spot a retain cycle within the delegate pattern. You may wonder which variable should be set as `weak`. The #1 rule is, a `weak` property has a reference to a class object which more likely to stays longer, and eventually has greater importance. For example, if the `SendingVC` object has a weak reference from the `recevingVC` property, the object will be deallocated immediately since the reference count is zero.

0 commit comments

Comments
 (0)