title: Swift 3 - Missing argument label '...' in call
body: <p>I am building a basic to-do list.</p>
  
  <p>I made a Swift file that intends to add items to a list</p>
  
  <pre><code>import UIKit
  
  class AddKey: UIViewController {
      @IBOutlet weak var keyValue: UILabel!
      @IBOutlet weak var keyDescription: UITextField!
  
      override func viewDidLoad() {
          super.viewDidLoad()
  
          // Do any additional setup after loading the view.
      }
  
      override func didReceiveMemoryWarning() {
      super.didReceiveMemoryWarning()
      // Dispose of any resources that can be recreated.
      }
  
      override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
          if segue.identifier == "dismissAndSaveKey" {
              let key = Key(description: keyDescription.text!)
              KeyStore.sharedInstance.add(key) // I get an ERROR at this line
          }
      }
  }
  </code></pre>
  
  <p>The error is: </p>
  
  <blockquote>
    <p>KeyStore.sharedInstance.add(key)", I get a "Missing argument label
    'key:' in call</p>
  </blockquote>
  
  <p>Now, KeyStore has a member </p>
  
  <p><code>var keys: [Key] = []</code></p>
  
  <p>And sharedInstance creates a static instance of the class</p>
  
  <p>Moreover, the add method is defined</p>
  
  <pre><code>func add(key: Key) {
      keys.append(key)
  }
  </code></pre>
  
  <p>Why would I have to specify the type of key in order to pass key to the add method? Moreover, if I do specify the type of key, the compiler complains that it expected type Key and not Key.type.</p>
  
  <p>If I write</p>
  
  <pre><code>KeyStore.sharedInstance.add(key)
  </code></pre>
  
  <p>as</p>
  
  <pre><code>KeyStore.sharedInstance.keys.append(key)
  </code></pre>
  
  <p>the error is gone and everything works.</p>