Alamofire 迁移到 swift 3 时遇到一些问题。我在工作之前就有了这段代码,现在我收到了一个错误。请参阅下面的代码:
let URL = Foundation.URL(string: Router.baseURLString)
let URLRequest = NSMutableURLRequest(url: URL!.appendingPathComponent(path))
let encoding = Alamofire.ParameterEncoding.URL
return encoding.encode(URLRequest, parameters: parameters).0
在“let编码=”行上收到错误。
错误:
类型“ParameterEncoding”没有成员“URL”
最佳答案
试试这个
Alamofire.ParameterEncoding.encode(URLRequest, parameters: parameters).0
关于swift - Alamofire 与 ParamerterEncoding 的迁移问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45450011/