SwiftMemory Management & ARC

1 items

FlashcardAdvanced

Retain Cycles, weak self and ARC

ARC frees objects when no strong references remain, but two objects strongly referencing each other create a retain cycle that leaks memory.

Question

What is a retain cycle, and how does `weak self` help prevent it?

Click to reveal answer