|
|
|
|
|
by masklinn
3321 days ago
|
|
> are named parameters considered the "default" choice in Swift Most definitely yes. In fact it used to be that the first parameter was implicitly positional (in Swift 2 IIRC), this was removed to make all parameters named by default. And do note that you can provide a single label for a parameter, it will be used as both "internal" and "external" names: func foo(bar: String) {
print(bar);
}
foo(bar: "3")
func baz(qux quux: String) {
print(quux);
}
baz(qux: "4")
> and is using different external names so commonAlso yes, it's absolutely ubiquitous, if only because that's the one way to provide "positional" parameter. |
|