@escaping vs @nonescaping closures

I know this is a frequently asked question, but...

After reading many articles on the net, I am still not sure if I have a solid understanding of the logics behind the design.

One of my puzzles around this question is - Is the Swift compiler clever enough so that I can solely rely on its warnings/errors?

Accepted Reply

Is the Swift compiler clever enough so that I can solely rely on its warnings/errors?

Yes. Unless you do something weird to actively subvert the checking — for example, invoking the withoutActuallyEscaping(_:do:) function — Swifts escape checking is reliable.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Replies

Is the Swift compiler clever enough so that I can solely rely on its warnings/errors?

Yes. Unless you do something weird to actively subvert the checking — for example, invoking the withoutActuallyEscaping(_:do:) function — Swifts escape checking is reliable.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"