flâneur — a map of the web's best reading

Automatic Reference Counting | Documentation

docs.swift.org · 92 words · saved by 1 readers

Swift uses Automatic Reference Counting (ARC) to track and manage your app’s memory usage. In most cases, this means that memory management “just works” in Swift, and you don’t need to think about memory management yourself. ARC automatically frees up the memory used by class instances when those instances are no longer needed. However, in a few cases ARC requires more information about the relationships between parts of your code in order to manage memory for you. This chapter describes those situations and shows how you enable ARC to manage all of your app’s memory. Using ARC in Swift is very similar to the approach described in Transitioning to ARC Release Notes for using ARC with Objective-C. Reference counting applies only to instances of classes. Structures and enumerations are value types, not reference types, and aren’t stored and passed by reference. Every time you create a new instance of a class, ARC allocates a chunk of memory to store information about that instance. This

To navigate the symbols, press Up Arrow, Down Arrow, Left Arrow or Right Arrow No items were found 1 item was found {number} items were found. Tab back to navigate through them. re looking for can't be found."},"color-scheme":{"select":"Select a color scheme preference","auto":"Auto","dark":"Dark","light":"Light"},"accessibility":{"strike":{"start":"start of stricken text","end":"end of stricken text"},"code":{"start":"start of code block","end":"end of code block"},"skip-navigation":"Skip Navigation","in-page-link":"in page link"},"select-language":"Select the language for this page","icons":

Explore this link on the map →

related reading