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

In this snippet, what is the relationship between the closure stored in handlers and the Controller instance, and what is the practical consequence?

class Controller { var value = 0 var handlers: [() -> Void] = [] func register() { handlers.append { self.value += 1 } } }