title: Swift: Cannot validate password
body: <p>I'm trying to validate passwords in swift with this library <code>SwiftValidator</code> (<a href="https://github.com/jpotts18/SwiftValidator" rel="nofollow noreferrer">https://github.com/jpotts18/SwiftValidator</a>) but I'm being thrown this error:</p>
  
  <blockquote>
    <p>Argument labels '(delegate:)' do not match any available overloads</p>
  </blockquote>
  
  <p><a href="https://i.stack.imgur.com/q53W2.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/q53W2.png" alt="SwiftValidator error"></a></p>
  
  <p>How can I fix it? Also, is it possible for me to use an AlertView to display my message instead of a label? (at <code>errorLabel: errorMsg</code>)</p>
  
  <p>This is my code:</p>
  
  <pre><code>import Foundation
  import UIKit
  import SwiftValidator
  import Alamofire
  
  class ResetPasswordViewController: UIViewController, UITextFieldDelegate {
  
  let validator = Validator()
  
  @IBOutlet weak var errorMsg: UILabel!
  
  @IBOutlet weak var usernameRP: UITextField!
  
  @IBOutlet weak var passwordRP: UITextField!
  
  @IBOutlet weak var confirmPasswordRP: UITextField!
  
  @IBAction func submitBtnRP(sender: AnyObject) {
      validator.validate(delegate:self)
  }
  
  
  override func viewDidLoad() {
      super.viewDidLoad()
  
      usernameRP.delegate = self
  
      passwordRP.delegate = self
  
      validator.registerField(usernameRP, rules: [RequiredRule(),  MinLengthRule(length: 4)])
  
      validator.registerField(passwordRP, rules: [RequiredRule(),  MinLengthRule(length: 6)])
  
      validator.registerField(confirmPasswordRP, errorLabel: errorMsg, rules: [ConfirmationRule(confirmField: passwordRP)])
  
  }
  
  override func didReceiveMemoryWarning() {
      super.didReceiveMemoryWarning()
  }
  
  func validationSuccessful() {
      // submit the form
  }
  
  func validationFailed(errors:[UITextField:ValidationError]) {
      // turn the fields to red
      for (field, error) in validator.errors {
          field.layer.borderColor = UIColor.redColor().CGColor
          field.layer.borderWidth = 1.0
          error.errorLabel?.text = error.errorMessage // works if you added labels
          error.errorLabel?.hidden = false
      }
  }
  }
  </code></pre>