Understanding Swift Memory Management

5 Episodes

Episode 2

07:05

What Are Strong Reference Cycles

In the previous installment of this series, you learned about Automatic Reference Counting and how it helps keep memory management in check. Remember that a class instance is deallocated if no properties, constants, or variables hold a strong reference to the class instance. I didn't explain what a strong reference is, though.

Episode 3

07:33

How to Break a Strong Reference Cycle

Strong reference cycles negatively impact your application's performance. They lead to memory leaks and unexpected behavior that is often hard to debug. In this episode, I show you how to resolve the strong reference cycles we created in the previous episode of this series.

Episode 4

06:49

What Is the Difference Between Strong, Weak, and Unowned References

In the previous episode of Understanding Swift Memory Management, you learned how weak and unowned references can break a strong reference cycle. What sets weak and unowned references apart from strong references? What is the difference between weak and unowned references? When is it appropriate to choose an unowned reference over a weak reference? We tackle these questions in this episode.