adspace


What is the difference between closure and function in swift?

Answer Posted / Manoj Kumar Chaubey

"A closure in Swift is a block of reusable code that can be passed around and used in your app. It is syntactically similar to a function but does not have a name. Functions, on the other hand, are named blocks of reusable code that perform an action or return a value. Closures can capture and store references to any constants and variables from the context in which they are defined."

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain some biggest changes in usernotifications.

926


How can you define a base class in swift?

931


Explain the common execution states for a swift ios app (ios application lifecycle).

900