Closures in Swift - Part 2
As we discussed the closure in detail in the previous blog as Closure in Swift - Part 1 . I would like to suggest to go first if you want to understand this better. Closures as Reference Types: As if we assign as let closure = closreReturnFromFunction() to constant but that does not mean that its constant and closure scope can not be changed. As you have seen in the previous Closure in Swift - Part 1 . that counter can be modified once the closure will execute, this is because closure is reference types. When we assigned closure to variable or constant we actually assigned closure reference not the content of closure. I Hope, it's clear !!. Escaping Closures: A closure is said to be escaping closure when it is passed as a function argument to the function and it will execute after the function returns from its scope. This is asynchronous in behavior. Let's understand what that does It means. It's simple. Trust me. So...