找到这些文章中应用代理,但无法弄清楚他们如何帮助:部分Web服务调用
let task = session.dataTask(with: request, completionHandler: {
(data, response, error) in
if error == nil {
let result = String(data: data!, encoding: String.Encoding.utf8)!
if WebService.THETA_INVALID == result {
failure(LoginService.INVALID_MESSAGE)
}
else if WebService.THETA_UNVALIDATED == result {
failure(LoginService.UNVALIDATED_MESSAGE)
}
else {
let loginCredentials = LoginCredentials()
loginCredentials.username = user
loginCredentials.password = password
loginCredentials.authorization = result
success()
}
} else {
failure(error!.localizedDescription)
}
})
task.resume()
:
Understanding crash report (Partial apply...) in Swift Swift closure crashes when called as Objective-C block
我越来越部分在下面的代码应用代理
错误object.failure包含“部分应用转发器”,我不知道这意味着什么。我试过Google搜索,它似乎与可选项有关,但大多数事情与Thunk有关?
任何人都可以帮我指出这个问题吗?