- Keeping the count of strong references
- The instance is not deallocated until the last strong reference is broken
- Problem: Memory Leak
- Cause: two strong references pointing to each other
- Solution:
- Weak references
- Unowned References
- Alwasys refers to an instance that has not been deallocated
- Runtime error occurs when access unowned reference after the instance has been deallocated
- An unowned optional reference can be nil
- Class
- Closure
- Basic types, like Bool, Int, etc.
- Struct
- Enum
- Tuple