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

Why does the closure stored in the array force the `@escaping` annotation here?

var handlers: [() -> Void] = [] func register(_ work: () -> Void) { // needs @escaping handlers.append(work) }