Think of an escaping block as code that jumps back to where the function was called originally. Meaning, if you have this method which executes the escaping block if variable is set to "yes":
func thisMethodHasA(variable: String, withAn escaping: @escaping (()->())) {
if variable == "yes" {
escaping()
//this will execute the code in the brackets
}
//this will return the method
}
and you call it like so (in playgrounds):
thisMethodHasA(variable: "no") {
print("the bracket code is executed")
}
print("thisMethodHasNowFinished")
the printed result is:
thisMethodHasNowFinished
As you see, the code is never executed.
If we set it to "yes":
thisMethodHasA(variable: "yes") {
print("the bracket code is executed")
}
print("thisMethodHasNowFinished")
the bracket code is executed
thisMethodHasNowFinished
As you see, the code inside the brackets was run before the method ended it's course.
So really, escaping blocks are pointers to code which only allocates a potential reference of memory space for that escaping block.. but without actually allocating that space until the escaping block is called. So i would say that escaping blocks are referenced similarly to how class references are performed to minimize memory allocation. So what your referenced sentence means, is that the code in escaping blocks keep a singular pointer throughout the app cycle, unlike a method pointer, which is deallocated whenever it's run it's course. By this definition, i'd suggest that it is stored in the stack, not the heap (to address your question).
I found these links/posts and articles which seem to get to a close answer too:
https://stackoverflow.com/a/41257089/7183483
For a good read on how Swift manages both Stack and Heap allocation:
https://medium.com/@itchyankles/memory-management-in-rust-and-swift-8ecda3cdf5b7
this one also explains the logic behind alocation.. so perhaps there is some hinting here at how these blocks are managed.. again, seems to be a lack of solid documentation on this topic out there!