Need Assistance?

support@tutorialshub.in

Classes, Inheritance & ARC Memory

Strong Retain Cycles (weak vs unowned)

ADVERTISEMENT
Swift Free Lesson
5 min read
ADVERTISEMENT

If Object A holds a strong reference to Object B and B holds a strong reference to A, neither is ever freed! Break retain cycles with weak var (always an Optional, becomes nil when freed) or unowned (when guaranteed to outlive).

ADVERTISEMENT
Hi, I'm Tuby! Here to help you