Type Safely

Type Safely

Share this post

Type Safely
Type Safely
Use Implicit Self After Unwrapping [weak self]
Copy link
Facebook
Email
Notes
More

Use Implicit Self After Unwrapping [weak self]

Daily Coding Tip 276

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

Share this post

Type Safely
Type Safely
Use Implicit Self After Unwrapping [weak self]
Copy link
Facebook
Email
Notes
More
Share
toddler looking at believe in yourself graffiti
Photo by Katrina Wright on Unsplash

Here’s another new Swift 5.8 feature.

In previous versions of the language, it was still necessary to make capture semantics specific after unwrapping [weak self]. In other words, [weak self] returns an optional version of self that you can unwrap into a non-optional version.

When self is no longer optional, it would ma…

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

Copy link
Facebook
Email
Notes
More