mkbrwr
(Mykhailo Tymchyshyn)
1
Encountered the next code
var thing = "cars"
let closure1 = { [thing] in
print("I love (thing)")
}
let closure2 = {
print("I love (thing)")
}
thing = "airplanes"
closure1() // I love cars
closure2() // I love airplanes
Why is the behaviour different for explicit and implicit capturing ?
mkbrwr
(Mykhailo Tymchyshyn)
3
Turns out there is document that answers my question directly, thanks for pointing it out. Now it's clear!
1 Like