[SOLVED] How to get function's parameter value without parameter name in swift?


func test(_: [Int]) {


I saw this code is valid in swift, how can I get the value passed into test?


To explicitly answer your question:

how can I get the value passed in test?

You can’t, in the same way that after

let _ = someFunction() 

you have no way to get at the return value of someFunction. That’s really the whole point of _ which basically means "I’m ignoring this intentionally".

Answered By – Gereon

Answer Checked By – Terry (BugsFixing Volunteer)

Leave a Reply

Your email address will not be published. Required fields are marked *