Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumSwiftretain cycles and capture listsSingle-choice MCQ

What is the retain behavior of `self` in this code?

class Loader { var onDone: (() -> Void)? func start() { DispatchQueue.global().async { [weak self] in guard let self else { return } self.onDone = { print(self.name) } } } var name = "L" }