Alamofire"模糊参考成员'下载(_:方法:参数:编码:标题:到:)'"

时间:2017-03-01 11:26:38

标签: swift swift3 alamofire

我正在尝试将我的代码迁移到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!)
        })

0 个答案:

没有答案