title: How to pass dictionary as a parameter in the method in Swift?
body: <p>I have created following method in my code:</p>
  
  <pre><code>func SignIn(objDictionary:Dictionary&lt;String,String&gt;)
  {
      //Body of method
  }
  </code></pre>
  
  <p>I need to pass the following dictionary as a parameter in this method which is defined below:</p>
  
  <pre><code>let objSignInDictionary:Dictionary = ["email":emailTextField.text, "password":passwordTextField.text]
  </code></pre>
  
  <p>How can I pass this dictionary in the above method as a parameter?</p>
  
  <p>This should be noted that method is in another class and I am calling the method by creating its object as follows: </p>
  
  <pre><code>let obj = Services()
  </code></pre>
  
  <p>SignIn is defined in Services.swift class
  so I am trying to call it like</p>
  
  <pre><code>obj.SignIn(objSignInDictionary) 
  </code></pre>
  
  <p>but getting following error</p>
  
  <pre><code>"String!" is not identical to "String"
  </code></pre>
  
  <p>Where I am wrong and how it can be fixed. I am stuck here since couple of days.</p>