External and local names

https://useyourloaf.com/blog/swift-named-parameters/

Local parameter names are used in the body of the function/method
External parameter names are used when calling the function/method.

The external names for all except the first parameter default to the local name

When we call myFunc, we’d do it like:

As you can see, when calling the function, we use the param names userName. However, for 2nd parameter and on, the external name is the same as local name.

You omit the name of the first parameter when calling the function/method (since it does not by default have an external name)

Using External Names

If you rather define your own external names, and not use the local names, you can do so also. Just define your external name in front of the local name

Our three parameters now have these external and local names:

external: message, local: message
external: withPrefix, local: prefix
external: andSuffix, local: suffix

The use of external parameter names can allow a function to be called in an expressive, sentence-like manner, while still providing a function body that is readable and clear in intent.