I want to make a method that can take variable number of parameters. Kind of like in javascript where I can get all the parameters using arguments keyword inside the function. How can I do this in Swift?
My main purpose is to allow all overloaded constructors to go to one method even if it has no parameters passed in it at all.
class Counter {
var count: Int = 0
func incrementBy(amount: Int, numberOfTimes: Int) {
count += amount * numberOfTimes
}
}