Variatic parameters
Swift has variadic parameters. This allows you to put multiple things into a function without having to use an array. It is notated with the range syntax “…”
|
|
You always have the option of using an array if you want, like:
|
|
But this is a cool alternative.
I had no idea this existed. I was looking for something else when doing research. Swift always surprises me.
Originally published 04/16/2021 @ https://pittcsc.org/ Discord
Published here on 09/08/2022. Blog published date reflects the original date of publication.