随着Swift 5介绍了Result类型,因此我在使用Alamofire时遇到了许多错误。
其他错误:
Enum case 'success' has no associated values
Member 'failure' in 'Result<T>' produces result of type 'Result<String>', but context expects 'Result<T>'
任何快速修复!
更改
Result
to
Alamofire.Result
或者创建一个typealias
,例如:
typealias AFResult = Alamofire.Result
将 Result
更改为 AFResult
。
Alamofire
版本中得到修复,所以现在你可以使用Alamofire.Result
。 - Kamran