how to set up an anonymous function to variable in swift 1

how to set up an anonymous function to variable in swift

let name = "Abhishek Bagela"

var getName: String {
 return name
}

Here is what the above code is Doing:
1. We have a constant name with a value of “Abhishek Bagela”.
2. We have a computed property getName that returns the value of name.
3. We have a computed property getName that returns the value of name.

Similar Posts