Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumSwiftescaping vs non-escaping closuresSingle-choice MCQ

Why does the compiler reject storing this escaping closure, and what fixes it?

class Store { var handlers: [() -> Void] = [] func add(_ handler: () -> Void) { handlers.append(handler) } }