Suggested approach: Variadic functions accept any number of parameters. Swift writes them using ...
, and we’re handed the parameters as an array. Again, try to give an example – something like print()
is a good place to start.
For bonus points, you could add that Swift 5.4 and later allow multiple variadic parameters.
Estimated difficulty: Intermediate
See the full list of iOS interview questions
Link copied to your pasteboard.