Cannot convert type : I want to call a simple api and return the struct of JSON returned from server. I am using alamofire to achieve this, however I cant get past this cannot convert type error.
this is my function

    func loginUser(user_name: String, password: String, callBack:(Login) -> Void){
        let parameters: Parameters = ["user_name":  user_name,"password": password];
        let urlString=serverURL+"login.php";
        Alamofire.request(urlString, method: .post, parameters: parameters, encoding: URLEncoding.httpBody)
            .responseJSON { response in
                if let status = response.response?.statusCode {
                    switch(status) {
                    case 200:
                        guard response.result.isSuccess else {
                            //error handling
                            return
                        }
                        if let login: Login = response.result.value {
                            callBack(login)
                        } else {
                            callBack(Login(user_id: 0, status:0))
                        }
                    default:
                        print("HTTP Error : \(status)")
                        callBack(Login(user_id: 0, status:0))
                    }
                }
        }
    }

i am getting this error in the line

    if let login: Login = response.result.value {