John Sundell 1/2/2022

Two ways of capturing self strongly within a closure

Read Original

This Swift programming article details two methods for creating a strong reference to 'self' within an escaping closure: explicitly using the 'self' keyword for each call, or using a capture list like [self] to avoid repetition. It discusses when strong capture is safe and also mentions moving logic to a dedicated method as an alternative.

Two ways of capturing self strongly within a closure

Comments

No comments yet

Be the first to share your thoughts!

Browser Extension

Get instant access to AllDevBlogs from your browser