로딩
요청 처리 중입니다...

[Swift] weak, unowned (Resolving S.R.C)

 [Swift] weak, unowned (Resolving S.R.C)

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...