Type Safely

Type Safely

Share this post

Type Safely
Type Safely
Using [unowned self] In a Closure To Reference Self Safely

Using [unowned self] In a Closure To Reference Self Safely

Daily Coding Tip 280

Type Safely's avatar
Type Safely
Apr 12, 2023
∙ Paid

Share this post

Type Safely
Type Safely
Using [unowned self] In a Closure To Reference Self Safely
Share
person holding DSLR camera
Photo by James Bold on Unsplash

When I explored the use of implicit self after unwrapping [weak self] in Daily Coding Tip 276, it was an example of a new Swift 5.8 feature. That feature made it possible to reference functions and properties inside a closure, but only after optional binding occurs.

With [unowned self], the reference to self is not optional…

Keep reading with a 7-day free trial

Subscribe to Type Safely to keep reading this post and get 7 days of free access to the full post archives.

Already a paid subscriber? Sign in
© 2025 Type Safely
Privacy ∙ Terms ∙ Collection notice
Start writingGet the app
Substack is the home for great culture

Share