Skip to content
RED SAG Skills
mediumStudy question · answer published in JavaScript interview questions, so no pointsswiftclosures

When @escaping is needed

Why must the completion parameter be marked @escaping here?

var handlers: [() -> Void] = []

func onFinish(_ completion: @escaping () -> Void) {
    handlers.append(completion)
}
Choose one answer

Discussion 0

Join free to post in the discussion.

Related questions