In fast, we can define a function like this:
func format(name: String)(email: String) -> String {
return "\(name)-\(email)"
}
I want to define a closure that looks like this function. But the compiler gives me an error. Here is my curry closure as follows:
let formatClosure = {(name: String)(email: String) -> String in "\(name)-\(email)"}
Is this just not possible in swift or is there some other syntax for it?
source
share