O'Reilly logo

Swift Quick Syntax Reference by Matthew Campbell

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter    49

Automatic Reference Counting

As your Swift program creates new instances, memory resources are used to store the information associated with each instance. When an instance is no longer needed, Swift will reclaim the resources associated with the instance so that these resources can be used with other instances.

The system that Swift uses to keep track of all your instances is called automatic reference counting (ARC). ARC works because Swift can keep a count of how many times an instance is referenced in a program. This is called the reference count. For the most part, you don’t need to manage this yourself since Swift takes care of reference counting automatically.

Note  In Chapter 42, you coded a deinit, which is a special ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required