Closure: Escaping

#@escaping

Overview

Keeps the data in memory for use later on.

Subjects

Sample Codes

init(location: Location, onSave: @escaping (Location) -> Void) {  // escape says to swift stay alive the memory we will call that later on
    self.location = location
    self.onSave = onSave

    _name = State(initialValue: location.name)
    _description = State(initialValue: location.description)
}
Hacking with Swift / 100 Days / Day-70 - Selecting and editing map annotations

...

Sources

Videos

Articles / Documents

See also

Last updated