What is the difference between closure and function in swift?
Answer / 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 |
Consider the following code: let op1: Int = 1 let op2: UInt = 2 let op3: Double = 3.34 var result = op1 + op2 + op3 Where is the error and why? How can it be fixed?
What is the difference between swift and ‘objective-c’ language?
In Swift How to connect UI under Swift Environment ?
How to add an element into an array?
Why is inheritance not desirable in swift?
What is the swift main advantage?
Does swift have a runtime?
What are the different collection types available in swift?
What are floating point numbers? How many types of floating number are there?
What is “defer”?
Is swift compiled or interpreted?
What is swift property?