210625 Fri

Sunny·2021년 7월 4일
0

Today I Learned

목록 보기
84/88

학습 내용

1. 첫 번째 학습 내용: ARC - weak references

Resolving Strong Reference Cycles Between Class Instances

Swift provides two ways to resolve strong reference cycles when you work with properties of class type: weak references and unowned references.

Weak and unowned references enable one instance in a reference cycle to refer to the other instance without keeping a strong hold on it. The instances can then refer to each other without creating a strong reference cycle.

Use a weak reference when the other instance has a shorter lifetime—that is, when the other instance can be deallocated first. In the Apartment example above, it’s appropriate for an apartment to be able to have no tenant at some point in its lifetime, and so a weak reference is an appropriate way to break the reference cycle in this case.

Automatic Reference Counting - The Swift Programming Language (Swift 5.5)

[Swift] Closure에서 weak self 의 사용

Capture Lists

Expressions - The Swift Programming Language (Swift 5.5)

2. 두 번째 학습 내용: serial queue vs. concurrent queue

Dispatch Queues

profile
iOS Developer

0개의 댓글