Memory Management in Swift
Understanding Memory Management, Strong, Weak and Unowned References Behind all the coding that we are doing, you may have noticed some of your variables with the reference of strong, weak or unowned when writing your codes. What is Memory Management and what does the reference really means? The usage of strong, weak or unowned are actually related to the memory management in Swift called Automatic Reference Counting also referred to as (ARC). Let’s slow down a little and try to understand what this means. So, ARC actually does automatic reference counting. In the definition of Computer Science, Reference Counting is a technique of storing number of references, pointers, or handles into a resources such as an object, block or memory, disk space or other resources. In short, ARC actually helps store references into memory and helps clean up when it is not being used. On a side note, reference counting in this case only applies to instance of classes and not structures and enumerations as they are both value types […]