Reputation: 1685
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:
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
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
Reputation: 1685
Here is how to fix the issue: validator.validate(delegate: self)
Upvotes: 0