PC パソコン

How to Fix “Argument Labels Do Not Match Any Available Overloads” in Swift

When calling a Swift function, method, or initializer, Xcode may report:

Argument labels do not match any available overloads

This error means that the argument-label combination at the call site does not match any available overload of the function, method, or initializer the compiler is considering.

Common causes include misspelled labels, confusing external argument labels with internal parameter names, adding labels to unlabeled parameters, using outdated API signatures, changing custom initializers, passing the wrong argument types, or selecting the wrong SwiftUI overload because of a Binding or optional mismatch.

The most reliable fix is to inspect the current declaration and make the argument labels, order, and types match one available signature exactly.

  1. What does “Argument labels do not match any available overloads” mean?
  2. What is an argument label?
  3. What is an overload?
  4. Typical situations where this error appears
  5. Common causes
    1. 1. A simple argument-label typo
    2. 2. Using the internal parameter name at the call site
    3. 3. Adding a label to an unlabeled parameter
    4. 4. Omitting a required argument label
    5. 5. Arguments are supplied in the wrong order
    6. 6. The function signature changed
    7. 7. An initializer uses different labels
    8. 8. A custom initializer changed the available call syntax
    9. 9. No overload accepts the supplied label combination
    10. 10. A wrong argument type removes the intended overload
    11. 11. Optional and non-optional types do not match
    12. 12. A SwiftUI Binding is replaced with a plain value
    13. 13. A custom SwiftUI @Binding property receives the wrong value
    14. 14. A trailing-closure label is wrong
    15. 15. Multiple trailing-closure labels do not match
    16. 16. An SDK update renamed an argument label
    17. 17. An old tutorial or sample uses outdated syntax
    18. 18. A generic type mismatch prevents the correct overload from being selected
    19. 19. A same-named function or type exists in another module
    20. 20. An earlier argument is the real problem
  6. What to check first
    1. 1. Inspect the current declaration
    2. 2. Check Xcode autocomplete
    3. 3. Verify argument types as well as labels
  7. Solution 1: Match argument labels to the declaration
  8. Solution 2: Use external argument labels
  9. Solution 3: Do not label parameters declared with _
  10. Solution 4: Do not omit required labels
  11. Solution 5: Follow parameter order
  12. Solution 6: Update calls after changing a function signature
  13. Solution 7: Use Xcode rename refactoring
  14. Solution 8: Match initializer labels exactly
  15. Solution 9: Check the effect of custom initializers
  16. Solution 10: Add the overload the call actually needs
  17. Solution 11: Fix argument types
  18. Solution 12: Unwrap optionals before calling a non-optional overload
  19. Solution 13: Pass SwiftUI bindings correctly
  20. Solution 14: Pass bindings to custom @Binding properties
  21. Solution 15: Inspect custom SwiftUI view initializers
  22. Solution 16: Match trailing-closure labels
  23. Solution 17: Match every multiple trailing-closure label
  24. Solution 18: Update old labels after an SDK change
  25. Solution 19: Do not assume old sample code still matches
  26. Solution 20: Add generic type context when overload resolution is ambiguous
  27. Solution 21: Make closure types explicit
  28. Solution 22: Qualify same-named types with the module
  29. Solution 23: Check access control
  30. Solution 24: Reduce a complex call to a known valid signature
  31. Solution 25: Use typed intermediate values
  32. Solution 26: Validate arguments from left to right
  33. Solution 27: Match SwiftUI Picker selection and tag types
  34. Solution 28: Keep NavigationLink and navigationDestination types consistent
  35. Solution 29: Simplify overloaded APIs when possible
  36. Solution 30: Rebuild the call from Xcode autocomplete
  37. If the error occurs in SwiftUI
  38. If the error occurs in an initializer
  39. If the error occurs in a function call
  40. If the labels appear correct
  41. Will Clean Build Folder or deleting DerivedData fix it?
  42. What you should avoid
  43. Fast troubleshooting checklist
  44. Summary

What does “Argument labels do not match any available overloads” mean?

Swift allows multiple functions with the same name when their parameter lists differ.

For example:

func show(name: String) { print(name) }

func show(id: Int) {
print(id)
}

These calls are valid:

show(name: "Alice") show(id: 10)

This one is not:

show( username: "Alice" )

No overload accepts the label username:.

What is an argument label?

A Swift parameter can have an external argument label and a separate internal parameter name:

func move( from start: Int, to end: Int ) { print(start) print(end) }

Here:

  • External argument labels: from and to
  • Internal parameter names: start and end

The call site uses the external labels:

move( from: 1, to: 10 )

This is incorrect:

move( start: 1, end: 10 )

What is an overload?

Functions can share the same name while differing in argument labels, parameter types, or parameter counts:

func load(id: Int) { }

func load(name: String) {
}

func load(
name: String,
cached: Bool
) {
}

Swift uses the call site’s labels and types to choose an overload.

If none of the available signatures match, overload resolution fails.

Typical situations where this error appears

  • An argument label is misspelled
  • An internal parameter name is used instead of the external label
  • A label is added to an unlabeled parameter
  • A required argument label is omitted
  • Arguments are in the wrong order
  • A function signature changed
  • An initializer label changed
  • Old API labels are used after an SDK or package update
  • A SwiftUI initializer is being called incorrectly
  • A custom view initializer no longer matches its call sites
  • A Binding is confused with a plain value
  • An optional mismatch removes the intended overload candidate
  • A trailing-closure label is wrong
  • A generic type mismatch prevents overload selection

Common causes

1. A simple argument-label typo

func greet( name: String ) { }

greet(
name: "Alice"
)

Using username: instead would not match this declaration.

2. Using the internal parameter name at the call site

func move( from start: Int, to end: Int ) { }

Incorrect:

move( start: 1, end: 10 )

Correct:

move( from: 1, to: 10 )

3. Adding a label to an unlabeled parameter

func square( _ value: Int ) -> Int { value * value }

Incorrect:

square( value: 10 )

Correct:

square(10)

4. Omitting a required argument label

func show( title: String ) { }

show(
title: "Hello"
)

Calling show("Hello") does not match this signature.

5. Arguments are supplied in the wrong order

func register( name: String, email: String ) { }

register(
name: "Alice",
email: "alice@example.com"
)

6. The function signature changed

Old:

func save( name: String ) { }

New:

func save( filename: String ) { }

An old call still using name: will no longer match.

7. An initializer uses different labels

struct User { let name: String
init(
    username: String
) {
    self.name = username
}

}

let user = User(
username: "Alice"
)

8. A custom initializer changed the available call syntax

struct ProfileView: View { let name: String
init(
    userName: String
) {
    self.name = userName
}

var body: some View {
    Text(name)
}

}

ProfileView(
userName: "Alice"
)

9. No overload accepts the supplied label combination

func open( id: Int ) { }

func open(
name: String
) {
}

No existing overload accepts both id and name together.

10. A wrong argument type removes the intended overload

func show( title: String, count: Int ) { }

show(
title: "Items",
count: 10
)

If title were an Int instead, the intended overload would stop matching even though the labels look correct.

11. Optional and non-optional types do not match

func show( user: User ) { }

let user: User? = loadUser()

An optional must usually be unwrapped before calling the User overload.

12. A SwiftUI Binding is replaced with a plain value

@State private var name = ""

TextField(
"Name",
text: $name
)

$name is Binding<String>, while name is String.

13. A custom SwiftUI @Binding property receives the wrong value

struct EditView: View { @Binding var name: String
var body: some View {
    Text(name)
}

}

EditView(
name: $name
)

14. A trailing-closure label is wrong

func perform( success: () -> Void, failure: () -> Void ) { }

perform {
print("Success")
} failure: {
print("Failure")
}

15. Multiple trailing-closure labels do not match

Later trailing closures must use the labels declared by the function.

16. An SDK update renamed an argument label

If an older call uses:

SomeAPI( value: data )

but the current API expects:

SomeAPI( content: data )

the old label will no longer match.

17. An old tutorial or sample uses outdated syntax

Swift, SwiftUI, and third-party package APIs can evolve over time.

18. A generic type mismatch prevents the correct overload from being selected

The labels may be correct, but unresolved or incompatible generic arguments can eliminate the intended overload.

19. A same-named function or type exists in another module

You may be calling the overloads of a different declaration than the one you intended.

20. An earlier argument is the real problem

Once Swift fails to match an earlier label or type, later arguments can produce misleading overload diagnostics.

What to check first

1. Inspect the current declaration

Use Xcode’s definition navigation to inspect the real signature.

For:

func move( from start: Int, to end: Int )

the call-site labels are from: and to:.

2. Check Xcode autocomplete

Retype the function or initializer name and inspect the overloads Xcode currently offers.

This is especially useful after refactoring or updating an SDK or package.

3. Verify argument types as well as labels

A matching label is not enough if its value has the wrong type.

Important: Despite the wording of the diagnostic, the root cause may be an optional, Binding, generic, or other type mismatch rather than the label itself.

Solution 1: Match argument labels to the declaration

func greet( name: String ) { }

greet(
name: "Alice"
)

Solution 2: Use external argument labels

func move( from start: Int, to end: Int ) { }

move(
from: 1,
to: 10
)

Solution 3: Do not label parameters declared with _

func square( _ value: Int ) -> Int { value * value }

let result = square(10)

Solution 4: Do not omit required labels

func show( title: String ) { }

show(
title: "Hello"
)

Solution 5: Follow parameter order

func send( to address: String, subject: String, body: String ) { }

send(
to: "example@example.com",
subject: "Hello",
body: "Message"
)

Solution 6: Update calls after changing a function signature

func save( filename: String ) { }

save(
filename: "data.json"
)

Solution 7: Use Xcode rename refactoring

When changing parameter names or argument labels, Xcode’s rename refactoring can update call sites and reduce stale labels throughout the project.

Solution 8: Match initializer labels exactly

struct User { let name: String
init(
    username: String
) {
    self.name = username
}

}

let user = User(
username: "Alice"
)

Solution 9: Check the effect of custom initializers

struct Product { let name: String let price: Int
init(
    title: String,
    price: Int
) {
    self.name = title
    self.price = price
}

}

let product = Product(
title: "Book",
price: 1000
)

Do not assume the property names automatically remain the initializer labels after defining a custom init.

Solution 10: Add the overload the call actually needs

func load( id: Int, name: String ) { }

if callers legitimately need to provide both values together.

Solution 11: Fix argument types

func show( title: String, count: Int ) { }

show(
title: "Items",
count: 10
)

Solution 12: Unwrap optionals before calling a non-optional overload

func show( user: User ) { }

if let user {
show(
user: user
)
}

Solution 13: Pass SwiftUI bindings correctly

@State private var text = ""

TextField(
"Name",
text: $text
)

Solution 14: Pass bindings to custom @Binding properties

struct EditView: View { @Binding var name: String
var body: some View {
    TextField(
        "Name",
        text: $name
    )
}

}

struct ContentView: View {
@State private var name = ""

var body: some View {
    EditView(
        name: $name
    )
}

}

Solution 15: Inspect custom SwiftUI view initializers

struct UserView: View { let name: String
var body: some View {
    Text(name)
}

}

UserView(
name: "Alice"
)

If you want a different label, define a custom initializer that provides it.

Solution 16: Match trailing-closure labels

func perform( success: () -> Void, failure: () -> Void ) { }

perform {
print("Success")
} failure: {
print("Failure")
}

Solution 17: Match every multiple trailing-closure label

Later trailing closures must use the exact labels required by the declaration.

Solution 18: Update old labels after an SDK change

If the current signature uses:

SomeAPI( content: content )

replace older calls that still use a renamed label.

Use current Xcode autocomplete, Quick Help, the declaration, and current package documentation.

Solution 19: Do not assume old sample code still matches

When code is copied from an older article or Q&A, compare every argument label with the API version your project currently compiles against.

Solution 20: Add generic type context when overload resolution is ambiguous

let values: [String] = []

process(values)

Giving empty or otherwise ambiguous values a concrete type can restore the intended overload candidate.

Solution 21: Make closure types explicit

let result = numbers.map { (value: Int) -> String in
String(value)

}

This can help when generic closure inference is contributing to overload failure.

Solution 22: Qualify same-named types with the module

MyFramework.User( name: "Alice" )

This makes it clear which initializer set should be considered.

Solution 23: Check access control

An initializer expected from another module may not be visible unless its access level allows it:

public init( name: String ) { self.name = name }

Solution 24: Reduce a complex call to a known valid signature

For a large call such as:

CustomView( title: title, user: user, settings: settings, enabled: enabled )

compare each argument against one specific initializer rather than trying to reason about every overload at once.

Solution 25: Use typed intermediate values

let titleValue: String = title let userValue: User = user let enabledValue: Bool = enabled

CustomView(
title: titleValue,
user: userValue,
enabled: enabledValue
)

This separates label problems from type problems.

Solution 26: Validate arguments from left to right

If:

SomeView( title: count, enabled: true )

uses an Int where title requires String, fix that first:

SomeView( title: String(count), enabled: true )

A later overload diagnostic may disappear.

Solution 27: Match SwiftUI Picker selection and tag types

@State private var selected = 0

Picker(
"Option",
selection: $selected
) {
Text("One").tag(0)
Text("Two").tag(1)
}

A mismatched tag type can make the intended generic Picker initializer impossible to resolve.

Solution 28: Keep NavigationLink and navigationDestination types consistent

struct User: Hashable { let id: Int }

NavigationLink(
value: user
) {
Text("Open")
}
.navigationDestination(
for: User.self
) { user in
UserView(user: user)
}

SwiftUI generic APIs require both labels and generic data types to line up.

Solution 29: Simplify overloaded APIs when possible

Large sets of similar overloads can make compiler diagnostics harder to interpret.

Clearer names can sometimes be preferable:

func loadUser(id: Int) { }

func loadUser(name: String) {
}

Solution 30: Rebuild the call from Xcode autocomplete

If an old call has several stale labels, retyping the method or initializer name and selecting a current autocomplete candidate can be faster and safer than patching the old call manually.

If the error occurs in SwiftUI

Check the following in order:

  1. Inspect the currently available initializer overloads.
  2. Check argument labels.
  3. Check argument order.
  4. Check every argument type.
  5. Check @Binding versus plain values.
  6. Check optional versus non-optional values.
  7. Check trailing-closure labels.
  8. Check generic data types.
  9. Fix any earlier compiler error first.

If the error occurs in an initializer

struct User { let name: String let age: Int
init(
    username: String,
    userAge: Int
) {
    self.name = username
    self.age = userAge
}

}

let user = User(
username: "Alice",
userAge: 20
)

The call must use the initializer’s external labels, not necessarily the stored-property names.

If the error occurs in a function call

func upload( file data: Data, completion: () -> Void ) { }

upload(
file: data
) {
print("Completed")
}

The external label and trailing closure match the declaration.

If the labels appear correct

Check for these less obvious causes:

  • An argument has the wrong type
  • Optional versus non-optional mismatch
  • Binding versus plain value mismatch
  • A generic parameter cannot be inferred
  • The compiler is considering another overload
  • A custom initializer changed available signatures
  • A same-named type from another module is being used
  • The SDK version changed the API signature

Will Clean Build Folder or deleting DerivedData fix it?

Usually not.

This diagnostic normally reflects a mismatch between source code and an available function or initializer signature.

You can clean the build folder:

Product → Clean Build Folder

or delete DerivedData:

rm -rf ~/Library/Developer/Xcode/DerivedData/*

when troubleshooting stale build artifacts, but neither action corrects invalid argument labels or incompatible types.

Note: Inspect the declaration and call site before treating this as an Xcode cache problem.

What you should avoid

Do not randomly add or remove argument labels until the compiler accepts the call.

Argument labels communicate the meaning of each parameter and form part of Swift’s function-call interface.

For example:

move( from: 1, to: 10 )

is intentionally expressive. Use the labels defined by the API rather than treating them as arbitrary syntax.

Fast troubleshooting checklist

  1. Open the function, method, or initializer declaration.
  2. Check external argument labels.
  3. Do not confuse external labels with internal parameter names.
  4. Check whether a parameter uses _ and therefore has no label.
  5. Verify argument order.
  6. Verify every argument type.
  7. Check optional versus non-optional values.
  8. In SwiftUI, check Binding versus plain values.
  9. Review custom initializers.
  10. Inspect available overloads in autocomplete.
  11. Check trailing-closure labels.
  12. Check generic type inference.
  13. Check for API signature changes after SDK or package updates.
  14. Inspect arguments before the highlighted problem.
  15. Split complex calls and add explicit types when needed.

Summary

Swift’s “Argument labels do not match any available overloads” error means that the argument-label combination at a call site does not match any function, method, or initializer overload currently available.

Common causes include misspelled labels, confusing external labels with internal parameter names, labeling an unlabeled parameter, incorrect argument order, function signature changes, and outdated API calls.

However, the labels themselves are not always the real problem. A wrong argument type, optional mismatch, SwiftUI Binding mismatch, or generic inference failure can remove the intended overload and leave Xcode reporting a label mismatch.

Start by inspecting the current declaration with Xcode’s definition navigation, Quick Help, and autocomplete. Then compare every label, argument order, and type with one specific overload.

In SwiftUI and generic APIs, also fix earlier type or binding diagnostics first because the argument-label error may only be a secondary result of overload resolution failure.