How to call API in background thread?
<p>I am using Alamofire for API calling in my app.</p>

<p>Now I want to call some API in background thread so when that API is called, other functionality work propely. So how can I do this in Alamofire?</p>

<p>this is how I am calling APi</p>

<pre><code>func GetDesignationList(pharmacyId : String,completion:(ManageDesignation : ManageDesignationListModel)-&gt; Void)  {
let url = "\(VendorURL)all_employee_designation_list"
let param : [String : AnyObject] = [

    "pharmacyId" : pharmacyId
]

Alamofire.request(.GET, url, parameters: param, encoding: .URL).responseObject { (response:Response&lt;ManageDesignationListModel, NSError&gt;) in
    switch response.result
    {
    case.Success(let value) :
        var ManageDesignationObject : ManageDesignationListModel?
        ManageDesignationObject = value
        completion(ManageDesignation: ManageDesignationObject!)
    case.Failure(let error) : break

    }
}

}
</code></pre>