'Method' is ambiguous for type lookup in this context, Error in Alamofire

后端 未结 11 1660
灰色年华
灰色年华 2020-12-20 10:52

I am using Alamofire for network handling in swift and run into one weird error. It seems like we can\'t pass Method enum as parameter.
[Error is on Method para

11条回答
  •  心在旅途
    2020-12-20 11:37

    The type Method is declared in two imported modules. You have to specify the module from which to use the type. Use Alamofire.Method instead of Method.

    Tip: If you are using the type often, you can create a type alias in your module (application):

    typealias Method = Alamofire.Method
    

    That way you will not need to prefix the type with Alamofire. any more.

提交回复
热议问题