What is the difference between weak, strong, and unowned references?
- qmshahzad
- Jun 10, 2025
- 1 min read
A:
strong: Default, increases reference count.
weak: Doesn’t increase count, allows deallocation (used in closures, optional).
unowned: Non-optional version of weak, assumes referenced object will never be nil after assignment.
Comments