func say(_ message: String, completion: (goodbye: String, name: String, age: Int) -> Void) {
Bjarne
1

Hey

When we write our swift functions, if we intend on returning Void (nothing), we dont need to put it at the end of the declaration.

func doSomething() -> Void // Not needed
func doSomething() // Shorter, nicer

So when you’re using a closure and decide not to name the arguments, and opt to use shorthand argument names instead. You dont need to specificy the in

say("Hi") { (name) -> Void in
print(name)
}
say("Hi") { (name) in
print(name)
}
say("Hi") { print($0) }

Hope this helps 🙌

Like what you read? Give Andyy Hope a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.