Missing argument label 'xxx' in call
Master System Design with Codemia
Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises.
Introduction
In Swift, function calls are part of the language's readability model, so parameter labels matter. The error "Missing argument label 'xxx' in call" means the function definition expects a labeled argument, but the call site omitted it or used the wrong label.
Why Swift uses argument labels
Swift separates the external label used at the call site from the internal parameter name used inside the function body. That makes calls read more like natural language.
For example:
The correct call is:
If you write this instead:
Swift reports missing argument labels because the function requires person: and from:.
Reading the function signature correctly
The first identifier in a parameter can be the external label, and the second is the local name:
At the call site:
If you omit one label or swap them, the compiler fails because the signature no longer matches.
How to intentionally remove a label
If you want a parameter to be unlabeled, use _ in the function definition:
Without the underscore, the function would require a label at the call site.
Initializers and methods follow the same rule
This error is not limited to free functions. It also appears with initializers and instance methods:
Calling User("Ava", 30) fails for the same reason: the synthesized initializer expects labeled arguments.
Methods behave the same way:
How to debug the error quickly
When Xcode reports this error, jump to the function definition and compare the parameter list with the call site exactly. Do not guess. The fix is usually one of these:
- add the missing label,
- rename the label at the call site,
- or change the definition to
_if the argument should be unlabeled.
Code completion is also useful because it inserts the expected labels automatically.
Common Pitfalls
The most common mistake is assuming the first parameter is unlabeled. In Swift methods and functions, that depends on the declaration, not on a universal rule you can memorize once.
Another issue is confusing parameter names with labels. In func greet(person name: String), person is the external label and name is the local variable inside the function.
Copying examples from older Swift versions can also be misleading because label behavior changed across major Swift releases. When in doubt, trust the current function signature shown by Xcode.
Finally, overloaded functions may require different labels even when they share a base name. If one overload takes at: and another takes from:, Swift treats them as different APIs.
This is why reading the generated function signature in Xcode is usually faster than reasoning from memory. The compiler is telling you exactly which external label the call site must use.
Summary
- The error means the call site does not match the labels required by the function signature.
- Swift uses argument labels to make calls clearer and safer.
- Read the declaration carefully and match the external labels exactly.
- Use
_in the declaration only when you intentionally want an unlabeled parameter. - The same label rules apply to functions, methods, and initializers.

