I have seen closures in Swift use $0
internally and sometimes they use $1
. What exactly is $0
and what are other $X
can you use?
Here are examples of it in use:
applyMutliplication(2, {$0 * 3})
array.map({$0 + 1})
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…