title: Expression resolves to an unused function (Swift)
body: <p>I am new to swift programming and need bit of your help forgive me if i am asking something stupid. I am trying call a function from my UIViewController for a POST request to API. Calling function is like this</p>
  
  <pre><code>    @IBAction func actionStartSignIn(sender: AnyObject) {
              let email: String = txtEmail.text!
              let password: String = txtPassword.text!
              if !email.isEmpty &amp;&amp; !password.isEmpty &amp;&amp; General.isValidEmail(email) &amp;&amp; password.characters.count&gt;6{
                  var request = RequestResponse()
                  request.email = email
                  request.password = password
                  let isValid = NSJSONSerialization.isValidJSONObject(request)
                  print(isValid)
                  var requestBody: String = ""
  
                  // Facing issue in following line
                RequestManager.sharedInstance.postRequest(Constants.BASE_URL + Constants.LOGIN, body: requestBody, onCompletion:  {(json: JSON) in{
                              let result = json["response"]
                              print(result)
  
                          }
                      }
                  )
              }
          } 
  </code></pre>
  
  <p>And Called Function is like this</p>
  
  <pre><code>func postRequest(route: String, body: String, onCompletion: (JSON) -&gt; Void) {
          makeHTTPPostRequest(route, requestBody: body, onCompletion: { json, err in
              onCompletion(json as JSON)
          })
      }
  </code></pre>
  
  <p>Further,</p>
  
  <pre><code>// MARK: Perform a POST Request
      private func makeHTTPPostRequest(path: String, requestBody: String, onCompletion: ServiceResponse) {
          let request = NSMutableURLRequest(URL: NSURL(string: path)!)
  
          // Set the method to POST
          request.HTTPMethod = "POST"
  
          do {
              // Set the POST body for the request
              // let jsonBody = try NSJSONSerialization.dataWithJSONObject(body, options: .PrettyPrinted)
              // request.HTTPBody = jsonBody
              request.HTTPBody = requestBody.dataUsingEncoding(NSUTF8StringEncoding);
              let session = NSURLSession.sharedSession()
  
              let task = session.dataTaskWithRequest(request, completionHandler: {data, response, error -&gt; Void in
                  if let jsonData = data {
                      let json:JSON = JSON(data: jsonData)
                      onCompletion(json, nil)
                  } else {
                      onCompletion(nil, error)
                  }
              })
              task.resume()
          }/*  catch {
              // error
              onCompletion(nil, nil)
          }*/
      }
  </code></pre>
  
  <p>and </p>
  
  <pre><code>typealias ServiceResponse = (JSON, NSError?) -&gt; Void
  </code></pre>
  
  <p>I am facing "Expression resolves to an unused function" while calling</p>
  
  <pre><code> RequestManager.sharedInstance.postRequest(Constants.BA‌​SE_URL + Constants.LOGIN, body: requestBody, onCompletion: {(json: JSON) in{ let result = json["response"] print(result) } } )
  </code></pre>
  
  <p>May be i am missing some basic syntax. Any help will be really appreciated.</p>
  
  <p>Thank You.  </p>