我正在尝试将我的代码迁移到Swift 3并且我无法找到Alamofire.download函数的解决方案。
如何使用返回部分迁移Alamofire下载功能?
我的代码:
Alamofire.download(.GET, url, destination: { temporaryURL, response in
if let name = response.suggestedFilename {
if fileName == nil {
fileName = name
} else {
fileName = fileName! + "." + NSString(string: name).pathExtension
}
if fileManager.fileExists(atPath: dataPath.appendingPathComponent(fileName!).path!) {
let tempName: NSString = fileName!
fileName = tempName.deletingPathExtension + "_copy." + tempName.pathExtension
}
}
return dataPath.appendingPathComponent(fileName!)
})