But why I can't modify a global context in which I would define the instance of structure Engine through an escaping closure? And at same time I can modify an instance of class Engine in the heap through an escaping closure.
I think that’s one of the main advantages of value types such as structures – since you can’t mutate them “from a distance”, they are much easier to reason about?
If you had an escaping closure that could modify the value you could store the closure and invoke it anytime later (think dispatch_after, for example), mutating the value. Then the whole guarantee about value types would go out of the window, wouldn’t it?
But in the book we read about clouser can store refer at the values from surround context even if the original scope no longer exist. At over that time a can not remember all treats of this chapter.
The one that escapes the function body; in this case, self. This ensures the escaping closure has ownership (i.e., it increases the reference count of the instance). Thus, if self is deleted, the escaping closure still has ownership and will not fail when it finally executes.