I define the below list swift class, and try to call the sfAuthenticateUser from the viewcontroller. But the Xcode intellisense list the wrong parameter type other than the type i defined.
ERROR : Cannot convert value of type 'String' to expected argument type 'APISFAuthentication'
Xcode Version 7.1 (7B91b)
//View Controller method call as below
@IBAction func ActionNext(sender: AnyObject) {
let sss = APISFAuthentication.sfAuthenticateUser(<#T##APISFAuthentication#>)
}
// Class Definition as below
class APISFAuthentication {
init(x: Float, y: Float) {
}
func sfAuthenticateUser(userEmail: String) -> Bool {
let manager = AFHTTPRequestOperationManager()
let postData = ["grant_type":"password","client_id":APISessionInfo.SF_CLIENT_ID,"client_secret":APISessionInfo.SF_CLIENT_SECRET,"username":APISessionInfo.SF_GUEST_USER,"password":APISessionInfo.SF_GUEST_USER_PASSWORD]
manager.POST(APISessionInfo.SF_APP_URL,
parameters: postData,
success: { (operation, responseObject) in
print("JSON: " + responseObject.description)
},
failure: { (operation, error) in
print("Error: " + error.localizedDescription)
})
return true;
}
}
Please refer to the screen shot