Quentin Del
Quentin Del

Reputation: 1685

Swift migration: Argument labels '(_:)' do not match any available overloads

I am a beginner swift developer and I am trying to migrate my app to Swift 3.

I keep having this error and don't know how to solve it. "Argument labels '(_:)' do not match any available overloads"

I am using Swift Validator and my code seems to be the same as the proposed one. https://github.com/jpotts18/SwiftValidator

My issue is possibly similar to those ones:

similar issue 1

similar issue 2

Do you have any idea? Thanks a lot

class UpdateContactViewController: UIViewController, UITableViewDelegate, UITableViewDataSource,ValidationDelegate, UITextFieldDelegate {
@available(iOS 2.0, *)
public func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {

}


let validator = Validator()
let realm = try! Realm()
var contact_identifier = "1"
var lastSelectedIndexPath: NSIndexPath?
@IBAction func save_button_hit(sender: AnyObject) {
    // text field validator
    validator.validate(self)
}

The error is highlighting "validator.validate(self)"

Thanks for your help

Upvotes: 0

Views: 476

Answers (2)

Federico Ojeda
Federico Ojeda

Reputation: 768

Remember that Swift 3 introduced mandatory labels for the parameters in a method call. So a call that was previously done as:

elem.perform(a)

is now done:

elem.perform(parameterName: a)

So the correct would be the following:

validator.validate(delegate: self)

Upvotes: 2

Quentin Del
Quentin Del

Reputation: 1685

Here is how to fix the issue: validator.validate(delegate: self)

Upvotes: 0

Related Questions