HN
Hacker News
Top
New
Best
Ask
Show
Jobs
Comment by amorde | Hacker News Reader
Parent
Full thread
amorde
·
You can also shorten it to:
{ doSomething($0) }
View on HN
slavapestov
·
Or just
doSomething
reednj
·
I wasn't aware of that syntax? It will just pass the arguments from the parent to the child in order?
jayrhynas
·
As long as the signature of the function matches you can pass it in directly
slavapestov
·
Functions are values in Swift. Closure literal syntax is just a shorthand where you don’t have to name the function first.
Reply on news.ycombinator.com