Tag: memory
-
Retain Cycle
Variables and constants in Swift can be a value type (their data is copied when they are copied) or a reference type (a pointer to the data is passed when they are copied. Structs, integers, and enums are value types, classes are reference types. Memory management of value types is relatively straightforward – there’s a…