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

In this code, which capture list entry breaks the retain cycle, and what is the lifetime risk that remains?

final class Controller { var handlers: [() -> Void] = [] func add() { handlers.append { [weak self] in self?.refresh() } } func refresh() {} }